Module: Aserto::Directory::V3::Reader
- Included in:
- Client
- Defined in:
- lib/aserto/directory/v3/reader.rb
Instance Method Summary collapse
-
#check(object_type:, object_id:, relation:, subject_type:, subject_id:, trace: false) ⇒ Aserto::Directory::Reader::V3::CheckResponse
Check relation between two objects.
-
#check_permission(object_type:, object_id:, permission:, subject_type:, subject_id:, trace: false) ⇒ Aserto::Directory::Reader::V3::CheckPermissionResponse
Check permission between two objects.
-
#check_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, trace: false) ⇒ Aserto::Directory::Reader::V3::CheckRelationResponse
Check relation between two objects.
-
#get_graph(object_type:, relation:, subject_type:, object_id: "", subject_id: "", subject_relation: "", explain: false, trace: false) ⇒ Aserto::Directory::Reader::V3::GetGraphResponse
Returns object graph from anchor to subject or object.
-
#get_object(object_type:, object_id:) ⇒ Aserto::Directory::Reader::V3::GetObjectResponse
find an object by id and type.
-
#get_objects(object_type:, page: { size: 100 }) ⇒ Aserto::Directory::V3::GetObjectsResponse
list objects by type.
-
#get_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "", with_objects: false) ⇒ Aserto::Directory::Reader::V3::GetRelationResponse
find a relation between two objects.
-
#get_relations(object_type: "", object_id: "", relation: "", subject_type: "", subject_id: "", subject_relation: "", with_objects: false, page: { size: 100 }) ⇒ Aserto::Directory::Reader::V3::GetRelationsResponse
List relations between two objects.
Instance Method Details
#check(object_type:, object_id:, relation:, subject_type:, subject_id:, trace: false) ⇒ Aserto::Directory::Reader::V3::CheckResponse
Check relation between two objects
181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/aserto/directory/v3/reader.rb', line 181 def check(object_type:, object_id:, relation:, subject_type:, subject_id:, trace: false) reader.check( Aserto::Directory::Reader::V3::CheckRequest.new( object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, trace: trace ) ) end |
#check_permission(object_type:, object_id:, permission:, subject_type:, subject_id:, trace: false) ⇒ Aserto::Directory::Reader::V3::CheckPermissionResponse
Check permission between two objects
214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/aserto/directory/v3/reader.rb', line 214 def (object_type:, object_id:, permission:, subject_type:, subject_id:, trace: false) reader.( Aserto::Directory::Reader::V3::CheckPermissionRequest.new( object_type: object_type, object_id: object_id, permission: , subject_type: subject_type, subject_id: subject_id, trace: trace ) ) end |
#check_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, trace: false) ⇒ Aserto::Directory::Reader::V3::CheckRelationResponse
Check relation between two objects
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/aserto/directory/v3/reader.rb', line 148 def check_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, trace: false) reader.check_relation( Aserto::Directory::Reader::V3::CheckRelationRequest.new( object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, trace: trace ) ) end |
#get_graph(object_type:, relation:, subject_type:, object_id: "", subject_id: "", subject_relation: "", explain: false, trace: false) ⇒ Aserto::Directory::Reader::V3::GetGraphResponse
Returns object graph from anchor to subject or object.
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/aserto/directory/v3/reader.rb', line 246 def get_graph(object_type:, relation:, subject_type:, object_id: "", subject_id: "", subject_relation: "", explain: false, trace: false) reader.get_graph( Aserto::Directory::Reader::V3::GetGraphRequest.new( object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, subject_relation: subject_relation, explain: explain, trace: trace ) ) end |
#get_object(object_type:, object_id:) ⇒ Aserto::Directory::Reader::V3::GetObjectResponse
find an object by id and type
20 21 22 23 24 25 26 27 |
# File 'lib/aserto/directory/v3/reader.rb', line 20 def get_object(object_type:, object_id:) reader.get_object( Aserto::Directory::Reader::V3::GetObjectRequest.new( object_type: object_type, object_id: object_id ) ) end |
#get_objects(object_type:, page: { size: 100 }) ⇒ Aserto::Directory::V3::GetObjectsResponse
list objects by type
44 45 46 47 48 49 50 51 |
# File 'lib/aserto/directory/v3/reader.rb', line 44 def get_objects(object_type:, page: { size: 100 }) reader.get_objects( Aserto::Directory::Reader::V3::GetObjectsRequest.new( object_type: object_type, page: Aserto::Directory::Common::V3::PaginationRequest.new(page) ) ) end |
#get_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "", with_objects: false) ⇒ Aserto::Directory::Reader::V3::GetRelationResponse
find a relation between two objects
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/aserto/directory/v3/reader.rb', line 74 def get_relation(object_type:, object_id:, relation:, subject_type:, subject_id:, subject_relation: "", with_objects: false) reader.get_relation( Aserto::Directory::Reader::V3::GetRelationRequest.new( object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, subject_relation: subject_relation, with_objects: with_objects ) ) end |
#get_relations(object_type: "", object_id: "", relation: "", subject_type: "", subject_id: "", subject_relation: "", with_objects: false, page: { size: 100 }) ⇒ Aserto::Directory::Reader::V3::GetRelationsResponse
List relations between two objects
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/aserto/directory/v3/reader.rb', line 112 def get_relations(object_type: "", object_id: "", relation: "", subject_type: "", subject_id: "", subject_relation: "", with_objects: false, page: { size: 100 }) reader.get_relations( Aserto::Directory::Reader::V3::GetRelationsRequest.new( object_type: object_type, object_id: object_id, relation: relation, subject_type: subject_type, subject_id: subject_id, subject_relation: subject_relation, with_objects: with_objects, page: Aserto::Directory::Common::V3::PaginationRequest.new(page) ) ) end |