Module: ActionAuthorizerHelper

Defined in:
lib/generators/action_authorizer/install/templates/app/helpers/action_authorizer_helper.rb

Instance Method Summary collapse

Instance Method Details

#authorized?(action, params = {}) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/generators/action_authorizer/install/templates/app/helpers/action_authorizer_helper.rb', line 2

def authorized?(action, params = {})
  authozired_controller? controller_path, action, params
end

#authozired_controller?(controller, action, params = {}) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/generators/action_authorizer/install/templates/app/helpers/action_authorizer_helper.rb', line 6

def authozired_controller?(controller, action, params = {})
  ActionAuthorizer::Base.authorized?(current_user, controller, action, params)
end