Class: SDM::Role
- Inherits:
-
Object
- Object
- SDM::Role
- Defined in:
- lib/models/porcelain.rb
Overview
A Role is a collection of access grants, and typically corresponds to a team, Active Directory OU, or other organizational unit. Users are granted access to resources by assigning them to roles.
Instance Attribute Summary collapse
-
#access_rules ⇒ Object
AccessRules JSON encoded access rules data.
-
#composite ⇒ Object
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
5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 |
# File 'lib/models/porcelain.rb', line 5415 def initialize( access_rules: nil, composite: nil, id: nil, name: nil, tags: nil ) if access_rules != nil @access_rules = access_rules end if composite != nil @composite = composite end if id != nil @id = id end if name != nil @name = name end if != nil @tags = end end |
Instance Attribute Details
#access_rules ⇒ Object
AccessRules JSON encoded access rules data.
5405 5406 5407 |
# File 'lib/models/porcelain.rb', line 5405 def access_rules @access_rules end |
#composite ⇒ Object
True if the Role is a composite role.
5407 5408 5409 |
# File 'lib/models/porcelain.rb', line 5407 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
5409 5410 5411 |
# File 'lib/models/porcelain.rb', line 5409 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
5411 5412 5413 |
# File 'lib/models/porcelain.rb', line 5411 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
5413 5414 5415 |
# File 'lib/models/porcelain.rb', line 5413 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5439 5440 5441 5442 5443 5444 5445 |
# File 'lib/models/porcelain.rb', line 5439 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 |