Class: SDM::RoleGrant
- Inherits:
-
Object
- Object
- SDM::RoleGrant
- Defined in:
- lib/models/porcelain.rb
Overview
A RoleGrant connects a resource to a role, granting members of the role access to that resource.
Instance Attribute Summary collapse
-
#id ⇒ Object
Unique identifier of the RoleGrant.
-
#resource_id ⇒ Object
The id of the resource of this RoleGrant.
-
#role_id ⇒ Object
The id of the attached role of this RoleGrant.
Instance Method Summary collapse
-
#initialize(id: nil, resource_id: nil, role_id: nil) ⇒ RoleGrant
constructor
A new instance of RoleGrant.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, resource_id: nil, role_id: nil) ⇒ RoleGrant
Returns a new instance of RoleGrant.
6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 |
# File 'lib/models/porcelain.rb', line 6406 def initialize( id: nil, resource_id: nil, role_id: nil ) if id != nil @id = id end if resource_id != nil @resource_id = resource_id end if role_id != nil @role_id = role_id end end |
Instance Attribute Details
#id ⇒ Object
Unique identifier of the RoleGrant.
6400 6401 6402 |
# File 'lib/models/porcelain.rb', line 6400 def id @id end |
#resource_id ⇒ Object
The id of the resource of this RoleGrant.
6402 6403 6404 |
# File 'lib/models/porcelain.rb', line 6402 def resource_id @resource_id end |
#role_id ⇒ Object
The id of the attached role of this RoleGrant.
6404 6405 6406 |
# File 'lib/models/porcelain.rb', line 6404 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6422 6423 6424 6425 6426 6427 6428 |
# File 'lib/models/porcelain.rb', line 6422 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 |