-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add property rules syntax and example to privileges page
add property rules example to limitations section add new section for property-based access control recomend to use Block Storage review fixes: limitations page update images for granting/denying privilege syntax Update modules/ROOT/pages/authentication-authorization/manage-privileges.adoc Co-authored-by: Phil Wright <[email protected]> review fixes review fixes review fix review fixes change header in limitations page Update modules/ROOT/pages/authentication-authorization/property-based-access-control.adoc Co-authored-by: Phil Wright <[email protected]> Apply suggestions from code review Co-authored-by: Reneta Popova <[email protected]>
- Loading branch information
1 parent
de1be82
commit ed2372f
Showing
7 changed files
with
177 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
modules/ROOT/pages/authentication-authorization/property-based-access-control.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
:description: How to use Cypher to manage property-based access control on graphs. | ||
|
||
//// | ||
[source, cypher, role=test-setup] | ||
---- | ||
CREATE ROLE regularUsers; | ||
---- | ||
//// | ||
|
||
[role=enterprise-edition aura-db-enterprise] | ||
[[property-based-access-control]] | ||
= Property-based access control | ||
|
||
It is possible to create read privileges that are based on properties of nodes. | ||
Each property-based privilege can only be restricted by a single property. | ||
To specify the property/value conditions of the read privilege the `pattern` syntax described below is used, | ||
for more information about read privilege syntax see xref:authentication-authorization/privileges-reads.adoc[read privilege] page. | ||
|
||
Adding property-based access control may lead to a significant performance overhead in certain scenarios. | ||
See xref:authentication-authorization/limitations.adoc#property-based-access-control-limitations[Limitations] for more detailed information. | ||
To reduce the performance impact, it is recommended to use the Block Storage format as it is better optimized for the kind of read required for the resolution of property-based privileges. | ||
|
||
Some of the factors that can worsen the impact on performance when having property rules are: | ||
|
||
* The number of properties on the nodes concerned (more properties = greater performance impact) | ||
* The number of property-based privileges (more property-based privileges = greater performance impact). | ||
* The type of the privilege: `TRAVERSE` property-based privileges have a greater performance impact than `READ` property-based privileges. | ||
* The type of storage medium in operation. The performance impact of property-based privileges will be considerably amplified by accessing disc storage. | ||
|
||
For performance-critical scenarios, it is recommended to design privileges based on labels. | ||
For more information, see xref:authentication-authorization/privileges-reads.adoc[Read privileges]. | ||
|
||
Pattern syntax: | ||
[source, syntax, role="noheader"] | ||
---- | ||
([var][:label["|" ...]] "{" property: value "}") | ||
| (var[:label["|" ...]]) WHERE [NOT] var.property { = value | <> value | IS NULL | IS NOT NULL } | ||
| (var[:label["|" ...]] WHERE [NOT] var.property { = value | <> value | IS NULL | IS NOT NULL } ) | ||
---- | ||
[NOTE] | ||
==== | ||
For more details about the syntax descriptions, see xref:database-administration/syntax.adoc[Cypher syntax for administration commands]. | ||
==== | ||
You can use this pattern syntax for defining read privileges as follows: | ||
|
||
[source, syntax, role="noheader"] | ||
---- | ||
GRANT ... ON GRAPH ... FOR pattern TO ... | ||
---- | ||
|
||
|
||
.Granting permission to `READ` the `address` property on `Email` or `Website` nodes with domain `exampledomain.com` to role `regularUsers`: | ||
[source, syntax, role="noheader"] | ||
---- | ||
GRANT READ { address } ON GRAPH * FOR (n:Email|Website) WHERE n.domain = 'exampledomain.com' TO regularUsers | ||
---- | ||
Alternatively, you can use the following syntax: | ||
[source, syntax, role="noheader"] | ||
---- | ||
GRANT READ { address } ON GRAPH * FOR (:Email|Website {domain: 'exampledomain.com'}) TO regularUsers | ||
---- | ||
|
||
|
||
.Granting permission to `TRAVERSE` nodes with label `Email` where property `classification` is `NULL` to role `regularUsers`: | ||
[source, syntax, role="noheader"] | ||
---- | ||
GRANT TRAVERSE ON GRAPH * FOR (n:Email) WHERE n.classification IS NULL TO regularUsers | ||
---- | ||
|
||
.Denying permission to `READ` and `TRAVERSE` nodes where the property `classification` is different from `UNCLASSIFIED` to role `regularUsers`: | ||
[source, syntax, role="noheader"] | ||
---- | ||
DENY MATCH {*} ON GRAPH * FOR (n) WHERE n.classification <> 'UNCLASSIFIED' TO regularUsers | ||
---- |