Class: Spree::RoleConfiguration::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/spree/core/role_configuration.rb

Overview

An internal structure for the association between a role and a set of permissions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, permission_sets) ⇒ Role

Returns a new instance of Role.



25
26
27
28
29
# File 'lib/spree/core/role_configuration.rb', line 25

def initialize(name, permission_sets)
  @name = name
  @permission_sets = Spree::Core::ClassConstantizer::Set.new
  @permission_sets.concat permission_sets
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



23
24
25
# File 'lib/spree/core/role_configuration.rb', line 23

def name
  @name
end

#permission_setsObject (readonly)

Returns the value of attribute permission_sets.



23
24
25
# File 'lib/spree/core/role_configuration.rb', line 23

def permission_sets
  @permission_sets
end