Class: AuthAssistant::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/auth_assistant/model/user_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#available_rolesObject

Returns the value of attribute available_roles.



13
14
15
# File 'lib/auth_assistant/model/user_config.rb', line 13

def available_roles
  @available_roles
end

#role_strategyObject

Returns the value of attribute role_strategy.



12
13
14
# File 'lib/auth_assistant/model/user_config.rb', line 12

def role_strategy
  @role_strategy
end

Instance Method Details

#available_strategiesObject



16
17
18
# File 'lib/auth_assistant/model/user_config.rb', line 16

def available_strategies
  [:admin_field, :role_field, :roles_field, :roles_mask, :role_assignment, :multi_role_assignment]
end

#strategy(name) ⇒ Object



20
21
22
23
# File 'lib/auth_assistant/model/user_config.rb', line 20

def strategy(name)
  n = name.to_s
  available_strategies.include?(n.to_sym) ? n.to_sym : :roles_field
end