Module: Neuron::Authorization::Controller::ClassMethods

Defined in:
lib/neuron/authorization.rb

Instance Method Summary collapse

Instance Method Details

#authorize_resources(options = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/neuron/authorization.rb', line 17

def authorize_resources(options = {})
  include Neuron::Authorization::Controller::ControllerExtension

  before_filter :authorize_resource
  has_scope(:authorize, type: :boolean, default: true) do |controller, scope|
    scope.accessible_by(controller.current_ability, controller.send(:authorization_action))
  end
end