Class: SDM::Role
- Inherits:
-
Object
- Object
- SDM::Role
- Defined in:
- lib/models/porcelain.rb
Overview
A Role has a list of access rules which determine which Resources the members of the Role have access to. An Account can be a member of multiple Roles via AccountAttachments.
Instance Attribute Summary collapse
-
#access_rules ⇒ Object
AccessRules is a list of access rules defining the resources this Role has access to.
-
#composite ⇒ Object
Composite is true if the Role is a composite role.
-
#id ⇒ Object
Unique identifier of the Role.
-
#name ⇒ Object
Unique human-readable name of the Role.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(access_rules: nil, composite: nil, id: nil, name: nil, tags: nil) ⇒ Role
constructor
A new instance of Role.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(access_rules: nil, composite: nil, id: nil, name: nil, tags: nil) ⇒ Role
Returns a new instance of Role.
4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 |
# File 'lib/models/porcelain.rb', line 4699 def initialize( access_rules: nil, composite: nil, id: nil, name: nil, tags: nil ) @access_rules = access_rules == nil ? SDM::_porcelain_zero_value_access_rules() : access_rules @composite = composite == nil ? false : composite @id = id == nil ? "" : id @name = name == nil ? "" : name @tags = == nil ? SDM::() : end |
Instance Attribute Details
#access_rules ⇒ Object
AccessRules is a list of access rules defining the resources this Role has access to.
4686 4687 4688 |
# File 'lib/models/porcelain.rb', line 4686 def access_rules @access_rules end |
#composite ⇒ Object
Composite is true if the Role is a composite role.
Deprecated: composite roles are deprecated, use multi-role via AccountAttachments instead.
4691 4692 4693 |
# File 'lib/models/porcelain.rb', line 4691 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
4693 4694 4695 |
# File 'lib/models/porcelain.rb', line 4693 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
4695 4696 4697 |
# File 'lib/models/porcelain.rb', line 4695 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
4697 4698 4699 |
# File 'lib/models/porcelain.rb', line 4697 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4713 4714 4715 4716 4717 4718 4719 |
# File 'lib/models/porcelain.rb', line 4713 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |