Module: WithAuthorization

Extended by:
ActiveSupport::Concern
Included in:
Api::BaseController, DiscussionsMessagesController
Defined in:
app/controllers/concerns/with_authorization.rb

Instance Method Summary collapse

Instance Method Details

#authorization_slugObject



20
21
22
# File 'app/controllers/concerns/with_authorization.rb', line 20

def authorization_slug
  protection_slug || '_/_'
end

#authorize_admin!Object



8
9
10
# File 'app/controllers/concerns/with_authorization.rb', line 8

def authorize_admin!
  authorize! :admin
end

#authorize_janitor!Object



4
5
6
# File 'app/controllers/concerns/with_authorization.rb', line 4

def authorize_janitor!
  authorize! :janitor
end

#authorize_moderator!Object



16
17
18
# File 'app/controllers/concerns/with_authorization.rb', line 16

def authorize_moderator!
  authorize! :moderator
end

#authorize_owner!Object



12
13
14
# File 'app/controllers/concerns/with_authorization.rb', line 12

def authorize_owner!
  authorize! :owner
end

#protection_slugObject



24
25
26
# File 'app/controllers/concerns/with_authorization.rb', line 24

def protection_slug
  @slug
end