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.
5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 |
# File 'lib/models/porcelain.rb', line 5293 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.
5280 5281 5282 |
# File 'lib/models/porcelain.rb', line 5280 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.
5285 5286 5287 |
# File 'lib/models/porcelain.rb', line 5285 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
5287 5288 5289 |
# File 'lib/models/porcelain.rb', line 5287 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
5289 5290 5291 |
# File 'lib/models/porcelain.rb', line 5289 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
5291 5292 5293 |
# File 'lib/models/porcelain.rb', line 5291 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5307 5308 5309 5310 5311 5312 5313 |
# File 'lib/models/porcelain.rb', line 5307 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 |