module Croods::Controller::Authorization
Public Instance Methods
policy_scope(scope)
click to toggle source
# File lib/croods/controller/authorization.rb, line 15 def policy_scope(scope) @_pundit_policy_scoped = true resource.policy_scope(action_name) .new(tenant: header_tenant, user: current_user, scope: scope).resolve end
Protected Instance Methods
forbidden(exception)
click to toggle source
# File lib/croods/controller/authorization.rb, line 23 def forbidden(exception) render status: :forbidden, json: { id: 'forbidden', message: exception.message } end