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
-
#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(id: nil, name: nil, composite: nil, tags: nil) ⇒ Role
constructor
A new instance of Role.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, name: nil, composite: nil, tags: nil) ⇒ Role
Returns a new instance of Role.
5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 |
# File 'lib/models/porcelain.rb', line 5441 def initialize( id: nil, name: nil, composite: nil, tags: nil ) if id != nil @id = id end if name != nil @name = name end if composite != nil @composite = composite end if != nil @tags = end end |
Instance Attribute Details
#composite ⇒ Object
True if the Role is a composite role.
5437 5438 5439 |
# File 'lib/models/porcelain.rb', line 5437 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
5433 5434 5435 |
# File 'lib/models/porcelain.rb', line 5433 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
5435 5436 5437 |
# File 'lib/models/porcelain.rb', line 5435 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
5439 5440 5441 |
# File 'lib/models/porcelain.rb', line 5439 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5461 5462 5463 5464 5465 5466 5467 |
# File 'lib/models/porcelain.rb', line 5461 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 |