Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions models/hospital/access-control-old.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[role=enterprise-edition]
[[auth-access-control]]
= Fine-grained access control
:description: Describes an example that illustrates various aspects of security and fine-grained access control.
:description: Describes an example that illustrates various aspects of security and fine-grained access control.

When creating a database, administrators may want to establish which users have the ability to access certain information.

As described in xref:authentication-authorization/built-in-roles/auth-built-in-roles[Built-in roles], Neo4j already offers preset roles configured to specific permissions (i.e. read, edit, or write).
As described in xref:authentication-authorization/built-in-roles/auth-built-in-roles[Built-in roles], Neo4j already offers preset roles configured to specific permissions (i.e. read, edit, or write).
While these built-in roles cover many common daily scenarios, it is also possible to create custom roles for specific needs.

This page contains an example that illustrates various aspects of security and fine-grained access control.
Expand Down Expand Up @@ -35,7 +35,7 @@ They can be described using the properties:
* `description`

`(:Disease)`::
Known illnesses mapped in a catalog found in the database.
Known illnesses mapped in a catalog found in the database.
They can be described using the properties:
+
* `name`
Expand Down Expand Up @@ -82,7 +82,7 @@ This same database would be used by a number of different users, each with diffe

Unlike applications which often require users to be modeled within the application itself, databases provide user management resources such as roles and privileges.
This allows users to be created entirely within the database security model, a strategy that allows the separation of access to the data and the data itself.
For more information, see link:/docs/cypher-manual/{neo4j-version}/access-control/[Cypher Manual -> Access control].
For more information, see link:{neo4j-docs-base-uri}/cypher-manual/current/access-control/[Cypher Manual -> Access control].

The following examples show two different approaches to using Neo4j security features to support the _healthcare_ database application.
The first approach uses xref:authentication-authorization/built-in-roles/auth-built-in-roles[Built-in roles], whereas the second uses more advanced resources with fine-grained privileges for <<auth-access-control-using-privileges, sub-graph access control>>.
Expand Down Expand Up @@ -128,13 +128,13 @@ Neo4j comes with built-in roles that cover a number of common needs:
* `architect` - Has all the capabilities of the publisher as well as the ability to manage indexes and constraints.
* `admin` - Can perform architect actions as well as manage databases, users, roles, and privileges.

Consider Charlie from the example of users.
Consider Charlie from the example of users.
As a researcher, they do not need write access to the database, so they are assigned the `reader` role.

On the other hand, Alice (the doctor), Daniel (the nurse), and Bob (the receptionist) all need to update the database with new patient information, but do not need to expand the schema with new labels, relationship types, property names or indexes.
On the other hand, Alice (the doctor), Daniel (the nurse), and Bob (the receptionist) all need to update the database with new patient information, but do not need to expand the schema with new labels, relationship types, property names or indexes.
For this reason, they are all assigned the `editor` role.

Tina, the IT administrator who installs and manages the database, needs to be assigned the `admin` role.
Tina, the IT administrator who installs and manages the database, needs to be assigned the `admin` role.

Here is how to grant roles to the users:

Expand Down Expand Up @@ -183,11 +183,11 @@ Has the permission to save _diagnoses_ to the database, but not expand the schem
Receptionist::
Should be able to read and write all patient data, but not be able to see the symptoms, diseases, or diagnoses.
Researcher::
Should be able to perform statistical analysis of all data, except patients’ personal information, to which they should have restricted access.
Should be able to perform statistical analysis of all data, except patients’ personal information, to which they should have restricted access.
To illustrate two different ways of setting up the same effective privileges, two roles are created for comparison.
Nurse::
Should be able to perform all tasks that both the doctor and the receptionist can do.
Granting both roles (doctor and receptionist) to the nurse does not work as expected.
Granting both roles (doctor and receptionist) to the nurse does not work as expected.
This is explained in the section dedicated to the creation of the `nurse` role.
Junior nurse::
While the senior nurse is able to save diagnoses just as a doctor can, some (junior) nurses might not be allowed to do that.
Expand Down Expand Up @@ -278,7 +278,7 @@ SHOW ROLE itadmin PRIVILEGES AS COMMANDS;

[NOTE]
====
Privileges that were granted or denied earlier can be revoked using link:/docs/cypher-manual/{neo4j-version}/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
Privileges that were granted or denied earlier can be revoked using link:{neo4j-docs-base-uri}/cypher-manual/current/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
====

To provide the IT administrator `tina` these privileges, they must be assigned the new role `itadmin`:
Expand Down Expand Up @@ -500,7 +500,7 @@ If the `researcherB` role is revoked to Charlie, but `researcherW` is granted, w

[NOTE]
====
Privileges that were granted or denied earlier can be revoked using link:/docs/cypher-manual/{neo4j-version}/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
Privileges that were granted or denied earlier can be revoked using link:{neo4j-docs-base-uri}/cypher-manual/current/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
====

=== Privileges of `doctor`
Expand Down Expand Up @@ -709,7 +709,7 @@ RETURN n.name, n.ssn, n.address, n.dateOfBirth;

[[detach-delete-restricted-user]]

With the `receptionist` role, Bob can delete any new patient nodes they have just created, but they are not able to delete patients that have already received diagnoses since those are connected to parts of the graph that Bob cannot see.
With the `receptionist` role, Bob can delete any new patient nodes they have just created, but they are not able to delete patients that have already received diagnoses since those are connected to parts of the graph that Bob cannot see.
Here is a demonstration of both scenarios:

[source, cypher]
Expand Down Expand Up @@ -787,7 +787,7 @@ GRANT DELETE ON GRAPH healthcare RELATIONSHIPS HAS, DIAGNOSIS TO receptionist;

[NOTE]
====
Privileges that were granted or denied earlier can be revoked using link:/docs/cypher-manual/{neo4j-version}/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
Privileges that were granted or denied earlier can be revoked using link:{neo4j-docs-base-uri}/cypher-manual/current/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
====

=== Privileges of nurses
Expand Down Expand Up @@ -838,7 +838,7 @@ SHOW USER daniel PRIVILEGES AS COMMANDS;

[NOTE]
====
Privileges that were granted or denied earlier can be revoked using link:/docs/cypher-manual/{neo4j-version}/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
Privileges that were granted or denied earlier can be revoked using link:{neo4j-docs-base-uri}/cypher-manual/current/access-control/manage-privileges/#access-control-revoke-privileges[the `REVOKE` command].
====

Now the intention is that a nurse can perform the actions of a receptionist, which means they should be able to read and write the `address` field of the `Patient` nodes.
Expand Down Expand Up @@ -1111,7 +1111,7 @@ neo4j@system> SHOW USER tina PRIVILEGES AS COMMANDS;
====
No other privilege management privileges were granted here.
How much power this role should have would depend on the requirements of the system.
Refer to the section link:/docs/cypher-manual/{neo4j-version}/access-control/built-in-roles/[Cypher Manual -> The `admin` role] for a complete list of privileges to consider.
Refer to the section link:{neo4j-docs-base-uri}/cypher-manual/current/access-control/built-in-roles/[Cypher Manual -> The `admin` role] for a complete list of privileges to consider.
====

Now Tina should be able to create new users and assign them to roles:
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/changes-deprecations-removals.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ For details, refer to the link:{neo4j-docs-base-uri}/java-reference/current/exte

This section lists all the Neo4j Server features deprecated in the 2025 series, including replacements where applicable.

For deprecations in Cypher language, see link:https://neo4j.com/docs/cypher-manual/current/deprecations-additions-removals-compatibility/[Cypher manual -> Deprecations, additions, and compatibility].
For deprecations in Cypher language, see llink:{neo4j-docs-base-uri}/cypher-manual/current/deprecations-additions-removals-compatibility/[Cypher manual -> Deprecations, additions, and compatibility].

=== Procedures

Expand Down