class Checkpoint::DB::Grant
Sequel model for grants
Public Class Methods
default_zone()
click to toggle source
The default/system zone
# File lib/checkpoint/db/grant.rb, line 19 def self.default_zone '(all)' end
from(agent, credential, resource, zone: default_zone)
click to toggle source
Instantiate a Grant
from the constituent domain objects (agent, resource, credential).
# File lib/checkpoint/db/grant.rb, line 9 def self.from(agent, credential, resource, zone: default_zone) new( agent_type: agent.type, agent_id: agent.id, agent_token: agent.token, credential_type: credential.type, credential_id: credential.id, credential_token: credential.token, resource_type: resource.type, resource_id: resource.id, resource_token: resource.token, zone_id: zone ) end