Skip to content

Commit 68f15bd

Browse files
committed
WIP relationship examples
1 parent 8881521 commit 68f15bd

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

modules/ROOT/pages/authentication-authorization/property-based-access-control.adoc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CREATE ROLE regularUsers;
1212
[[property-based-access-control]]
1313
= Property-based access control
1414

15-
Property-based access control grants permissions to users to read node properties based on property/value conditions.
15+
Property-based access control grants permissions to users to read element properties based on property/value conditions.
1616
Each property-based privilege can only be restricted by a single property.
1717
For information about read privileges and their syntax, see xref:authentication-authorization/privileges-reads.adoc[Read privileges].
1818

@@ -40,7 +40,9 @@ To specify the property/value conditions of the read privilege, you can use the
4040
| FOR {
4141
4242
([var][:label["|" ...]] "{" property: value "}")
43-
| (var[:label["|" ...]])
43+
| (var[:label["|" ...]])
44+
| ()[<]-"["[var][:type["|" ...]] "{" property: value "}" "]"-[>]()
45+
| ()[<]-"["var[:type["|" ...]]"]"-[>]()
4446
WHERE [NOT] var.property { { = | <> | > | >= | < | <= } value | IS NULL | IS NOT NULL | IN { "["[value[, ...]]"]" | listParam } }
4547
| (var[:label["|" ...]]
4648
WHERE [NOT] var.property { { = | <> | > | >= | < | <= } value | IS NULL | IS NOT NULL | IN { "["[value[, ...]]"]" | listParam } } )
@@ -57,7 +59,7 @@ See xref:authentication-authorization/limitations.adoc#property-based-access-con
5759

5860
When having property rules, the following factors can worsen the impact on performance:
5961

60-
* The number of properties on the nodes concerned (more properties = greater performance impact).
62+
* The number of properties on the elements concerned (more properties = greater performance impact).
6163
* The number of property-based privileges (more property-based privileges = greater performance impact).
6264
* The type of the privilege: `TRAVERSE` property-based privileges have greater performance impact than `READ` property-based privileges.
6365
* The type of storage medium in operation. The impact of the property-based privileges on performance is considerably amplified by accessing disc storage.
@@ -81,7 +83,7 @@ GRANT privilege-name ON GRAPH graph-name FOR pattern TO role-name
8183
The user role does not need to have `READ` privilege for the property used by the property-based privilege.
8284
====
8385

84-
=== Grant a property-based privilege on a specific property using its value
86+
=== Grant a property-based privilege on a specific property using the value of another property
8587

8688
The following example shows how to grant permission to `READ` the `address` property on `Email` or `Website` nodes with domain `exampledomain.com` to role `regularUsers`:
8789

@@ -97,6 +99,14 @@ Alternatively, you can use the following syntax:
9799
GRANT READ { address } ON GRAPH * FOR (:Email|Website {domain: 'exampledomain.com'}) TO regularUsers
98100
----
99101

102+
=== Grant a property-based privilege on a specific property using the value of that same property
103+
104+
The following example shows how to grant permission to `READ` the `since` property on `OWNS` relationships having `since` equal to `2025-01-01` to role `regularUsers`:
105+
106+
[source, syntax, role="noheader"]
107+
----
108+
GRANT READ { since } ON GRAPH * FOR ()-[o:OWNS]-() WHERE o.since = date("2025-01-01") TO regularUsers
109+
----
100110

101111
=== Grant a property-based privilege using `NULL`
102112

0 commit comments

Comments
 (0)