Class: AbilitiesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/abilities_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#dashboard, #keyboard_tools, #upload

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/abilities_controller.rb', line 5

def index
  @abilities = Ability.all
end

#recalcObject



16
17
18
19
# File 'app/controllers/abilities_controller.rb', line 16

def recalc
  @user.community_user.recalc_privileges
  redirect_to user_privileges_url(@user.id)
end

#showObject



9
10
11
12
13
14
# File 'app/controllers/abilities_controller.rb', line 9

def show
  @ability = Ability.where(internal_id: params[:id]).first
  return not_found if @ability.nil?

  @your_ability = @user&.community_user&.privilege @ability.internal_id
end