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



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

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



21
22
23
# File 'lib/spree/core/role_configuration.rb', line 21

def name
  @name
end

#permission_setsObject (readonly)

Returns the value of attribute permission_sets



21
22
23
# File 'lib/spree/core/role_configuration.rb', line 21

def permission_sets
  @permission_sets
end