Module: WithAuthorization

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

Instance Method Summary collapse

Instance Method Details

#authorization_slugObject



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

def authorization_slug
  protection_slug || '_/_'
end

#authorize_janitor!Object



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

def authorize_janitor!
  authorize! :janitor
end

#authorize_owner!Object



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

def authorize_owner!
  authorize! :owner
end

#protection_slugObject



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

def protection_slug
  @slug
end