Class: Authority::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/authority/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/authority/configuration.rb', line 6

def initialize
  @default_strategy = Proc.new { |able, authorizer, user|
    false
  }

  @abilities = {
    :create => 'creatable',
    :read   => 'readable',
    :update => 'updatable',
    :delete => 'deletable'
  }

  @authority_actions = {
    :index   => 'read',
    :show    => 'read',
    :new     => 'create',
    :create  => 'create',
    :edit    => 'update',
    :update  => 'update',
    :destroy => 'delete'
  }

  @user_method = :current_user

  @logger = Logger.new(STDERR)
end

Instance Attribute Details

#abilitiesObject

Returns the value of attribute abilities.



4
5
6
# File 'lib/authority/configuration.rb', line 4

def abilities
  @abilities
end

#authority_actionsObject

Returns the value of attribute authority_actions.



4
5
6
# File 'lib/authority/configuration.rb', line 4

def authority_actions
  @authority_actions
end

#default_strategyObject

Returns the value of attribute default_strategy.



4
5
6
# File 'lib/authority/configuration.rb', line 4

def default_strategy
  @default_strategy
end

#loggerObject

Returns the value of attribute logger.



4
5
6
# File 'lib/authority/configuration.rb', line 4

def logger
  @logger
end

#user_methodObject

Returns the value of attribute user_method.



4
5
6
# File 'lib/authority/configuration.rb', line 4

def user_method
  @user_method
end