lib/authority/configuration.rb in authority-1.0.0.pre4 vs lib/authority/configuration.rb in authority-1.0.0
- old
+ new
@@ -1,16 +1,17 @@
module Authority
class Configuration
# Has default settings, overrideable in the initializer.
- attr_accessor :default_strategy, :abilities, :controller_action_map, :user_method, :logger
+ attr_accessor :default_strategy, :abilities, :controller_action_map, :user_method, :security_violation_handler, :logger
def initialize
- @default_strategy = Proc.new { |able, authorizer, user|
+ @default_strategy = Proc.new do |able, authorizer, user|
false
- }
+ end
+
@abilities = {
:create => 'creatable',
:read => 'readable',
:update => 'updatable',
@@ -26,9 +27,11 @@
:update => 'update',
:destroy => 'delete'
}
@user_method = :current_user
+
+ @security_violation_handler = :authority_forbidden
@logger = Logger.new(STDERR)
end
end