Class: PermissionManagement::UserRolesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/permission_management/user_roles_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#pm_current_user

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/permission_management/user_roles_controller.rb', line 3

def index
  @targets = user_model.page(params[:page]).per(10)
end

#updateObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/permission_management/user_roles_controller.rb', line 7

def update
  if pm_current_user.super_admin?
    @target = user_model.find params[:id]
    @target.pm_role_id = params[:role_id]
    @target.save
  else
    render :js => 'alert("Sorry you do not have the permission!")'
  end
end