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.
5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 |
# File 'lib/models/porcelain.rb', line 5273 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.
5267 5268 5269 |
# File 'lib/models/porcelain.rb', line 5267 def id @id end |
#resource_id ⇒ Object
The id of the resource of this RoleGrant.
5269 5270 5271 |
# File 'lib/models/porcelain.rb', line 5269 def resource_id @resource_id end |
#role_id ⇒ Object
The id of the attached role of this RoleGrant.
5271 5272 5273 |
# File 'lib/models/porcelain.rb', line 5271 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5289 5290 5291 5292 5293 5294 5295 |
# File 'lib/models/porcelain.rb', line 5289 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 |