Class: SDM::Role
- Inherits:
-
Object
- Object
- SDM::Role
- Defined in:
- lib/models/porcelain.rb
Overview
A Role is a collection of permissions, 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.
Instance Method Summary collapse
-
#initialize(id: nil, name: nil, composite: nil) ⇒ Role
constructor
A new instance of Role.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, name: nil, composite: nil) ⇒ Role
Returns a new instance of Role.
4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 |
# File 'lib/models/porcelain.rb', line 4932 def initialize( id:nil \ , name:nil \ , composite:nil \ ) if id != nil @id = id end if name != nil @name = name end if composite != nil @composite = composite end end |
Instance Attribute Details
#composite ⇒ Object
True if the Role is a composite role.
4931 4932 4933 |
# File 'lib/models/porcelain.rb', line 4931 def composite @composite end |
#id ⇒ Object
Unique identifier of the Role.
4927 4928 4929 |
# File 'lib/models/porcelain.rb', line 4927 def id @id end |
#name ⇒ Object
Unique human-readable name of the Role.
4929 4930 4931 |
# File 'lib/models/porcelain.rb', line 4929 def name @name end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4949 4950 4951 4952 4953 4954 4955 |
# File 'lib/models/porcelain.rb', line 4949 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 |