/**
  * Handle the role delete. Need to check
  * @return mixed
  */
 public function handleRoleUpdate()
 {
     PermApi::access_check('manage_permissions');
     $roleName = Input::get('role');
     $roleId = Input::get('roleId');
     $SentryPermission = new SentryPermission();
     if ($SentryPermission->updateRole($roleId, $roleName)) {
         SentryHelper::setMessage('Role updated');
     } else {
         SentryHelper::setMessage('Role not updated', 'warning');
     }
     return Redirect::to('user/role/edit/' . $roleId);
 }
Exemple #2
0
 /**
  * Handling the entity delete ajax requests.
  */
 public function entityDeleteHandle()
 {
     $entity = Input::get('entity');
     $entityId = Input::get('entityId');
     switch ($entity) {
         case 'user':
             $table = 'users';
             DB::table($table)->where('id', $entityId)->delete();
             SentryHelper::setMessage('The user has been deleted');
             break;
         case 'role':
             $SentryPermission = new SentryPermission();
             $SentryPermission->deleteRole($entityId);
             break;
     }
 }