module Authz::Controllers::AuthorizationManager
Include this module in any controller that should be capable of performing authorization or in the ApplicationController to make the whole app capable. @api public
Protected Instance Methods
apply_authz_scopes(on:)
click to toggle source
Applies the current user's scoping rules on the given relation or class @param on [ActiveRecord_Relation, Class] on top of which the user's scoping rules will be applied @return [ActiveRecord_Relation] resulting collection from applying all user's roles scoping rules @api public @!visibility public
# File lib/authz/controllers/authorization_manager.rb, line 161 def apply_authz_scopes(on:) ScopingManager.apply_scopes_for_user(on, authz_user) end
authz_user()
click to toggle source
Hook method to allow customization of user used in the authorization process
# File lib/authz/controllers/authorization_manager.rb, line 168 def authz_user send(Authz.current_user_method) end