Class: Authority::Configuration
- Inherits:
-
Object
- Object
- Authority::Configuration
- Defined in:
- lib/authority/configuration.rb
Instance Attribute Summary collapse
-
#abilities ⇒ Object
Has default settings, which can be overridden in the initializer.
-
#controller_action_map ⇒ Object
Has default settings, which can be overridden in the initializer.
-
#logger ⇒ Object
Has default settings, which can be overridden in the initializer.
-
#security_violation_handler ⇒ Object
Has default settings, which can be overridden in the initializer.
-
#user_method ⇒ Object
Has default settings, which can be overridden in the initializer.
Instance Method Summary collapse
- #default_strategy=(val) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/authority/configuration.rb', line 8 def initialize @abilities = { :create => 'creatable', :read => 'readable', :update => 'updatable', :delete => 'deletable' } @controller_action_map = { :index => 'read', :show => 'read', :new => 'create', :create => 'create', :edit => 'update', :update => 'update', :destroy => 'delete' } @user_method = :current_user @security_violation_handler = :authority_forbidden @logger = Logger.new(STDERR) end |
Instance Attribute Details
#abilities ⇒ Object
Has default settings, which can be overridden in the initializer.
6 7 8 |
# File 'lib/authority/configuration.rb', line 6 def abilities @abilities end |
#controller_action_map ⇒ Object
Has default settings, which can be overridden in the initializer.
6 7 8 |
# File 'lib/authority/configuration.rb', line 6 def controller_action_map @controller_action_map end |
#logger ⇒ Object
Has default settings, which can be overridden in the initializer.
6 7 8 |
# File 'lib/authority/configuration.rb', line 6 def logger @logger end |
#security_violation_handler ⇒ Object
Has default settings, which can be overridden in the initializer.
6 7 8 |
# File 'lib/authority/configuration.rb', line 6 def security_violation_handler @security_violation_handler end |
#user_method ⇒ Object
Has default settings, which can be overridden in the initializer.
6 7 8 |
# File 'lib/authority/configuration.rb', line 6 def user_method @user_method end |
Instance Method Details
#default_strategy=(val) ⇒ Object
34 35 36 |
# File 'lib/authority/configuration.rb', line 34 def default_strategy=(val) raise ArgumentError, "`config.default_strategy=` was removed in Authority 2.0; see README and CHANGELOG" end |