Class: SDM::AccountPermission
- Inherits:
-
Object
- Object
- SDM::AccountPermission
- Defined in:
- lib/models/porcelain.rb
Overview
AccountPermission represents an individual API action available to an account.
Instance Attribute Summary collapse
-
#account_id ⇒ Object
The unique identifier of the Account this permission belongs to.
-
#granted_at ⇒ Object
The most recent time at which the permission was granted.
-
#permission ⇒ Object
The value of this permission, split into vertical and action e.g.
-
#scope ⇒ Object
The scope of this permission.
-
#scoped_id ⇒ Object
The ID to which or in whose context this operation is permitted.
Instance Method Summary collapse
-
#initialize(account_id: nil, granted_at: nil, permission: nil, scope: nil, scoped_id: nil) ⇒ AccountPermission
constructor
A new instance of AccountPermission.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(account_id: nil, granted_at: nil, permission: nil, scope: nil, scoped_id: nil) ⇒ AccountPermission
Returns a new instance of AccountPermission.
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 |
# File 'lib/models/porcelain.rb', line 1295 def initialize( account_id: nil, granted_at: nil, permission: nil, scope: nil, scoped_id: nil ) @account_id = account_id == nil ? "" : account_id @granted_at = granted_at == nil ? nil : granted_at = == nil ? "" : @scope = scope == nil ? "" : scope @scoped_id = scoped_id == nil ? "" : scoped_id end |
Instance Attribute Details
#account_id ⇒ Object
The unique identifier of the Account this permission belongs to.
1278 1279 1280 |
# File 'lib/models/porcelain.rb', line 1278 def account_id @account_id end |
#granted_at ⇒ Object
The most recent time at which the permission was granted. If a permission was granted, revoked, and granted again, this will reflect the later time.
1281 1282 1283 |
# File 'lib/models/porcelain.rb', line 1281 def granted_at @granted_at end |
#permission ⇒ Object
The value of this permission, split into vertical and action e.g. 'secretstore:List', 'role:update'
1284 1285 1286 |
# File 'lib/models/porcelain.rb', line 1284 def end |
#scope ⇒ Object
The scope of this permission. A global scope means this action can be taken on any entity; otherwise the action can only be taken on or in the scope of the scoped id.
1288 1289 1290 |
# File 'lib/models/porcelain.rb', line 1288 def scope @scope end |
#scoped_id ⇒ Object
The ID to which or in whose context this operation is permitted. e.g. The ID of a role that a team leader has the abillity to remove and add accounts to, or the ID of a resource that a user has the permission to connect to. If Scope is global, scoped id is not populated.
1293 1294 1295 |
# File 'lib/models/porcelain.rb', line 1293 def scoped_id @scoped_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1309 1310 1311 1312 1313 1314 1315 |
# File 'lib/models/porcelain.rb', line 1309 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 |