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.
4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 |
# File 'lib/models/porcelain.rb', line 4777 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.
4764 4765 4766 |
# File 'lib/models/porcelain.rb', line 4764 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.
4769 4770 4771 |
# File 'lib/models/porcelain.rb', line 4769 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
4771 4772 4773 |
# File 'lib/models/porcelain.rb', line 4771 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
4773 4774 4775 |
# File 'lib/models/porcelain.rb', line 4773 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
4775 4776 4777 |
# File 'lib/models/porcelain.rb', line 4775 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4791 4792 4793 4794 4795 4796 4797 |
# File 'lib/models/porcelain.rb', line 4791 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 |