Class: Verifica::ResourceConfiguration
- Inherits:
-
Object
- Object
- Verifica::ResourceConfiguration
- Defined in:
- lib/verifica/resource_configuration.rb
Overview
Note:
Use Configuration#register_resource instead of this class directly
Configuration object for resources registered in Authorizer
Instance Attribute Summary collapse
-
#acl_provider ⇒ #call
readonly
Access Control List provider for this resource type.
-
#possible_actions ⇒ Set<Symbol>
readonly
Set of actions possible for this resource type.
-
#resource_type ⇒ Symbol
readonly
Type of the resource.
Instance Method Summary collapse
-
#initialize(resource_type, possible_actions, acl_provider) ⇒ ResourceConfiguration
constructor
A new instance of ResourceConfiguration.
Constructor Details
#initialize(resource_type, possible_actions, acl_provider) ⇒ ResourceConfiguration
Note:
Use Configuration#register_resource instead of this constructor directly
Returns a new instance of ResourceConfiguration.
32 33 34 35 36 37 38 39 40 |
# File 'lib/verifica/resource_configuration.rb', line 32 def initialize(resource_type, possible_actions, acl_provider) @resource_type = resource_type.to_sym @possible_actions = action_set(possible_actions).freeze if acl_provider.nil? raise Error, "'#{@resource_type}' resource acl_provider should not be nil" end @acl_provider = acl_provider freeze end |
Instance Attribute Details
#acl_provider ⇒ #call (readonly)
Returns Access Control List provider for this resource type.
26 27 28 |
# File 'lib/verifica/resource_configuration.rb', line 26 def acl_provider @acl_provider end |
#possible_actions ⇒ Set<Symbol> (readonly)
Returns set of actions possible for this resource type.
21 22 23 |
# File 'lib/verifica/resource_configuration.rb', line 21 def possible_actions @possible_actions end |
#resource_type ⇒ Symbol (readonly)
Returns type of the resource.
16 17 18 |
# File 'lib/verifica/resource_configuration.rb', line 16 def resource_type @resource_type end |