Module: Authority::Controller::ClassMethods

Defined in:
lib/authority/controller.rb

Instance Method Summary collapse

Instance Method Details

#authority_action(action_map) ⇒ Object



18
19
20
# File 'lib/authority/controller.rb', line 18

def authority_action(action_map)
  self.authority_actions.merge!(action_map).symbolize_keys
end

#check_authorization_on(model_class, options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/authority/controller.rb', line 12

def check_authorization_on(model_class, options = {})
  self.authority_resource = model_class
  self.authority_actions  = Authority.configuration.authority_actions.merge(options[:actions] || {}).symbolize_keys
  before_filter :run_authorization_check, options
end