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.
4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 |
# File 'lib/models/porcelain.rb', line 4974 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.
4970 4971 4972 |
# File 'lib/models/porcelain.rb', line 4970 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
4966 4967 4968 |
# File 'lib/models/porcelain.rb', line 4966 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
4968 4969 4970 |
# File 'lib/models/porcelain.rb', line 4968 def name @name end |
#tags ⇒ Object
Tags is a map of key, value pairs.
4972 4973 4974 |
# File 'lib/models/porcelain.rb', line 4972 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4994 4995 4996 4997 4998 4999 5000 |
# File 'lib/models/porcelain.rb', line 4994 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 |