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