Class: Checkpoint::DB::Query::AC
- Inherits:
-
CartesianSelect
- Object
- CartesianSelect
- Checkpoint::DB::Query::AC
- Defined in:
- lib/checkpoint/db/query/ac.rb
Overview
A query object based on agents and credentials.
This query finds grants for any supplied agents, for any supplied credentials. Its primary purpose is to find which resources for which an agent has been granted a given credential.
It can take single items or arrays and converts them all to their tokens for query purposes.
Instance Attribute Summary collapse
-
#agents ⇒ Object
readonly
Returns the value of attribute agents.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
Attributes inherited from CartesianSelect
Instance Method Summary collapse
- #conditions ⇒ Object
-
#initialize(agents, credentials, scope: Grant) ⇒ AC
constructor
A new instance of AC.
- #parameters ⇒ Object
Methods inherited from CartesianSelect
Constructor Details
Instance Attribute Details
#agents ⇒ Object (readonly)
Returns the value of attribute agents.
14 15 16 |
# File 'lib/checkpoint/db/query/ac.rb', line 14 def agents @agents end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
14 15 16 |
# File 'lib/checkpoint/db/query/ac.rb', line 14 def credentials @credentials end |
Instance Method Details
#conditions ⇒ Object
22 23 24 25 26 27 |
# File 'lib/checkpoint/db/query/ac.rb', line 22 def conditions super.merge( agent_token: agent_params.placeholders, credential_token: credential_params.placeholders ) end |
#parameters ⇒ Object
29 30 31 32 33 34 |
# File 'lib/checkpoint/db/query/ac.rb', line 29 def parameters super.merge(Hash[ agent_params.values + credential_params.values ]) end |