Module: Troles::Common::Api::Core::ClassMethods
- Defined in:
- lib/troles/common/api/core.rb
Instance Method Summary collapse
-
#static_roles? ⇒ true, false
If all role subjects using this strategy should have static (immutable) roles.
- #valid_roles ⇒ Object
- #valid_roles=(*roles) ⇒ Object
Instance Method Details
#static_roles? ⇒ true, false
Note:
Should also proxy Config object?
If all role subjects using this strategy should have static (immutable) roles
46 47 48 |
# File 'lib/troles/common/api/core.rb', line 46 def static_roles? troles_config.static_roles? end |
#valid_roles ⇒ Object
33 34 35 |
# File 'lib/troles/common/api/core.rb', line 33 def valid_roles troles_config.valid_roles end |
#valid_roles=(*roles) ⇒ Object
37 38 39 |
# File 'lib/troles/common/api/core.rb', line 37 def valid_roles= *roles troles_config.valid_roles = roles.flatten.map{|r| r.to_s.alpha_numeric}.map(&:to_sym).uniq end |