@@ -69,8 +69,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
6969 query = """
7070 MATCH (account:%(generic_account_node)s)
7171 WHERE account.uuid = $account_id
72- CALL {
73- WITH account
72+ CALL (account) {
7473 MATCH (account)-[r:IS_PART_OF]-(root:Root)
7574 WHERE %(branch_filter)s
7675 RETURN account as account1, r as r1
@@ -80,8 +79,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
8079 WITH account, r1 as r
8180 WHERE r.status = "active"
8281 WITH account
83- CALL {
84- WITH account
82+ CALL (account) {
8583 MATCH (account)-[r1:IS_RELATED]->(:Relationship {name: "group_member"})<-[r2:IS_RELATED]-(account_group:%(account_group_node)s)
8684 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
8785 WITH account_group, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -92,8 +90,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
9290 }
9391 WITH account_group
9492
95- CALL {
96- WITH account_group
93+ CALL (account_group) {
9794 MATCH (account_group)-[r1:IS_RELATED]->(:Relationship {name: "role__accountgroups"})<-[r2:IS_RELATED]-(account_role:%(account_role_node)s)
9895 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
9996 WITH account_role, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -104,8 +101,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
104101 }
105102 WITH account_role
106103
107- CALL {
108- WITH account_role
104+ CALL (account_role) {
109105 MATCH (account_role)-[r1:IS_RELATED]->(:Relationship {name: "role__permissions"})<-[r2:IS_RELATED]-(global_permission:%(global_permission_node)s)
110106 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
111107 WITH global_permission, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -116,7 +112,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
116112 }
117113 WITH global_permission
118114
119- CALL {
115+ CALL (global_permission) {
120116 WITH global_permission
121117 MATCH (global_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "action"})-[r2:HAS_VALUE]->(global_permission_action:AttributeValue)
122118 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
@@ -127,8 +123,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
127123 WITH global_permission, global_permission_action, is_active AS gpa_is_active
128124 WHERE gpa_is_active = TRUE
129125
130- CALL {
131- WITH global_permission
126+ CALL (global_permission) {
132127 MATCH (global_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "decision"})-[r2:HAS_VALUE]->(global_permission_decision:AttributeValue)
133128 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
134129 RETURN global_permission_decision, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -183,8 +178,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
183178 query = """
184179 MATCH (account:%(generic_account_node)s)
185180 WHERE account.uuid = $account_id
186- CALL {
187- WITH account
181+ CALL (account) {
188182 MATCH (account)-[r:IS_PART_OF]-(root:Root)
189183 WHERE %(branch_filter)s
190184 RETURN account as account1, r as r1
@@ -194,8 +188,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
194188 WITH account, r1 as r
195189 WHERE r.status = "active"
196190 WITH account
197- CALL {
198- WITH account
191+ CALL (account) {
199192 MATCH (account)-[r1:IS_RELATED]->(:Relationship {name: "group_member"})<-[r2:IS_RELATED]-(account_group:%(account_group_node)s)
200193 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
201194 WITH account_group, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -206,8 +199,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
206199 }
207200 WITH account_group
208201
209- CALL {
210- WITH account_group
202+ CALL (account_group) {
211203 MATCH (account_group)-[r1:IS_RELATED]->(:Relationship {name: "role__accountgroups"})<-[r2:IS_RELATED]-(account_role:%(account_role_node)s)
212204 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
213205 WITH account_role, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -218,8 +210,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
218210 }
219211 WITH account_role
220212
221- CALL {
222- WITH account_role
213+ CALL (account_role) {
223214 MATCH (account_role)-[r1:IS_RELATED]->(:Relationship {name: "role__permissions"})<-[r2:IS_RELATED]-(object_permission:%(object_permission_node)s)
224215 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
225216 WITH object_permission, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -230,8 +221,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
230221 }
231222 WITH object_permission
232223
233- CALL {
234- WITH object_permission
224+ CALL (object_permission) {
235225 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "namespace"})-[r2:HAS_VALUE]->(object_permission_namespace:AttributeValue)
236226 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
237227 RETURN object_permission_namespace, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -240,8 +230,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
240230 }
241231 WITH object_permission, object_permission_namespace, is_active AS opn_is_active
242232 WHERE opn_is_active = TRUE
243- CALL {
244- WITH object_permission
233+ CALL (object_permission) {
245234 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "name"})-[r2:HAS_VALUE]->(object_permission_name:AttributeValue)
246235 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
247236 RETURN object_permission_name, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -250,8 +239,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
250239 }
251240 WITH object_permission, object_permission_namespace, object_permission_name, is_active AS opn_is_active
252241 WHERE opn_is_active = TRUE
253- CALL {
254- WITH object_permission
242+ CALL (object_permission) {
255243 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "action"})-[r2:HAS_VALUE]->(object_permission_action:AttributeValue)
256244 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
257245 RETURN object_permission_action, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -260,8 +248,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
260248 }
261249 WITH object_permission, object_permission_namespace, object_permission_name, object_permission_action, is_active AS opa_is_active
262250 WHERE opa_is_active = TRUE
263- CALL {
264- WITH object_permission
251+ CALL (object_permission) {
265252 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "decision"})-[r2:HAS_VALUE]->(object_permission_decision:AttributeValue)
266253 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
267254 RETURN object_permission_decision, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -336,8 +323,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
336323 query = """
337324 MATCH (account_role:%(account_role_node)s)
338325 WHERE account_role.uuid = $role_id
339- CALL {
340- WITH account_role
326+ CALL (account_role) {
341327 MATCH (account_role)-[r:IS_PART_OF]-(root:Root)
342328 WHERE %(branch_filter)s
343329 RETURN account_role as account_role1, r as r1
@@ -348,8 +334,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
348334 WHERE r.status = "active"
349335 WITH account_role
350336
351- CALL {
352- WITH account_role
337+ CALL (account_role) {
353338 MATCH (account_role)-[r1:IS_RELATED]->(:Relationship {name: "role__permissions"})<-[r2:IS_RELATED]-(global_permission:%(global_permission_node)s)
354339 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
355340 WITH global_permission, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -360,8 +345,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
360345 }
361346 WITH global_permission
362347
363- CALL {
364- WITH global_permission
348+ CALL (global_permission) {
365349 MATCH (global_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "action"})-[r2:HAS_VALUE]->(global_permission_action:AttributeValue)
366350 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
367351 RETURN global_permission_action, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -371,8 +355,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
371355 WITH global_permission, global_permission_action, is_active AS gpa_is_active
372356 WHERE gpa_is_active = TRUE
373357
374- CALL {
375- WITH global_permission
358+ CALL (global_permission) {
376359 MATCH (global_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "decision"})-[r2:HAS_VALUE]->(global_permission_decision:AttributeValue)
377360 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
378361 RETURN global_permission_decision, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -425,8 +408,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
425408 query = """
426409 MATCH (account_role:%(account_role_node)s)
427410 WHERE account_role.uuid = $role_id
428- CALL {
429- WITH account_role
411+ CALL (account_role) {
430412 MATCH (account_role)-[r:IS_PART_OF]-(root:Root)
431413 WHERE %(branch_filter)s
432414 RETURN account_role as account_role1, r as r1
@@ -437,8 +419,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
437419 WHERE r.status = "active"
438420 WITH account_role
439421
440- CALL {
441- WITH account_role
422+ CALL (account_role) {
442423 MATCH (account_role)-[r1:IS_RELATED]->(:Relationship {name: "role__permissions"})<-[r2:IS_RELATED]-(object_permission:%(object_permission_node)s)
443424 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
444425 WITH object_permission, r1, r2, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -449,8 +430,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
449430 }
450431 WITH object_permission
451432
452- CALL {
453- WITH object_permission
433+ CALL (object_permission) {
454434 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "namespace"})-[r2:HAS_VALUE]->(object_permission_namespace:AttributeValue)
455435 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
456436 RETURN object_permission_namespace, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -459,8 +439,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
459439 }
460440 WITH object_permission, object_permission_namespace, is_active AS opn_is_active
461441 WHERE opn_is_active = TRUE
462- CALL {
463- WITH object_permission
442+ CALL (object_permission) {
464443 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "name"})-[r2:HAS_VALUE]->(object_permission_name:AttributeValue)
465444 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
466445 RETURN object_permission_name, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -469,8 +448,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
469448 }
470449 WITH object_permission, object_permission_namespace, object_permission_name, is_active AS opn_is_active
471450 WHERE opn_is_active = TRUE
472- CALL {
473- WITH object_permission
451+ CALL (object_permission) {
474452 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "action"})-[r2:HAS_VALUE]->(object_permission_action:AttributeValue)
475453 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
476454 RETURN object_permission_action, (r1.status = "active" AND r2.status = "active") AS is_active
@@ -479,8 +457,7 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa
479457 }
480458 WITH object_permission, object_permission_namespace, object_permission_name, object_permission_action, is_active AS opa_is_active
481459 WHERE opa_is_active = TRUE
482- CALL {
483- WITH object_permission
460+ CALL (object_permission) {
484461 MATCH (object_permission)-[r1:HAS_ATTRIBUTE]->(:Attribute {name: "decision"})-[r2:HAS_VALUE]->(object_permission_decision:AttributeValue)
485462 WHERE all(r IN [r1, r2] WHERE (%(branch_filter)s))
486463 RETURN object_permission_decision, (r1.status = "active" AND r2.status = "active") AS is_active
0 commit comments