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.
6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 |
# File 'lib/models/porcelain.rb', line 6635 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.
6631 6632 6633 |
# File 'lib/models/porcelain.rb', line 6631 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
6627 6628 6629 |
# File 'lib/models/porcelain.rb', line 6627 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
6629 6630 6631 |
# File 'lib/models/porcelain.rb', line 6629 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
6633 6634 6635 |
# File 'lib/models/porcelain.rb', line 6633 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6655 6656 6657 6658 6659 6660 6661 |
# File 'lib/models/porcelain.rb', line 6655 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 |