Ejemplo n.º 1
0
 public function updatePermission($permission_role_id, $staff_permission_id)
 {
     $role_model = new RoleModel();
     $response = array();
     if ($role_model->permissionExists($staff_permission_id)) {
         # code...
         $role_array = array();
         $role_array[PermissionRoleTable::permission_role_id] = $permission_role_id;
         $role_array[PermissionRoleTable::staff_permission_id] = $staff_permission_id;
         $feedback = $role_model->update($role_array);
         if ($feedback) {
             $response[P_STATUS] = STATUS_OK;
         } else {
             $response[P_STATUS] = STATUS_ERROR;
             $response[P_MESSAGE] = "Unable to update staff permission!";
         }
     } else {
         $response[P_STATUS] = STATUS_ERROR;
         $response[P_MESSAGE] = "Invalid permission!";
     }
     return $response;
 }