Skip to content

Commit 93b7a0b

Browse files
committed
apply suggestions from review
1 parent 39ac4e7 commit 93b7a0b

File tree

8 files changed

+178
-121
lines changed

8 files changed

+178
-121
lines changed

modules/ROOT/pages/authentication-authorization/dbms-administration.adoc

Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,14 @@ The xref:authentication-authorization/built-in-roles.adoc#access-control-built-i
7979

8080
These include:
8181

82-
* Create, delete, and modify databases and aliases.
82+
* <<access-control-dbms-administration-database-management, Create, delete, and modify databases>> and <<access-control-dbms-administration-alias-management, aliases>>.
8383
* Change configuration parameters.
84-
* Manage transactions.
85-
* Manage users and roles.
86-
* Manage sub-graph privileges.
87-
* Manage procedure security.
88-
* Load data.
84+
* xref:authentication-authorization/database-administration.adoc#access-control-database-administration-transaction[Manage transactions].
85+
* Manage <<access-control-dbms-administration-role-management, users>> and <<access-control-dbms-administration-user-management, roles>>.
86+
* Manage sub-graph <<access-control-dbms-administration-privilege-management, privileges>>.
87+
* Manage <<access-control-dbms-administration-impersonation, impersonation privileges>>.
88+
* Manage <<access-control-dbms-administration-execute, procedure security>>.
89+
* Manage <<access-control-dbms-administration-load-privileges, load data security>>.
8990

9091
To enable a user to perform these tasks, you can grant them the `admin` role, but it is also possible to make a custom role with a subset of these privileges.
9192
All privileges are also assignable using Cypher commands.
@@ -148,7 +149,7 @@ To create a more powerful administrator, you can grant a different set of privil
148149

149150
=== Create a custom administrator role by copying the `admin` role
150151

151-
You can also create a custom administrator role that can perform almost all DBMS capabilities, excluding database management.
152+
You can also create a custom administrator role that can perform almost all DBMS capabilities, excluding database management.
152153
This is done by copying the `admin` role and denying the privileges you do not want.
153154
However, the role still has some limited database capabilities, such as managing transactions:
154155

@@ -177,7 +178,7 @@ DENY DATABASE MANAGEMENT ON DBMS TO customAdministrator
177178
GRANT TRANSACTION MANAGEMENT (*) ON DATABASE * TO customAdministrator
178179
----
179180
+
180-
As a result, the `customAdministrator` role has privileges that include all DBMS privileges except creating, dropping, and modifying databases and aliases, as well as managing transactions.
181+
As a result, the `customAdministrator` role has privileges that include all DBMS privileges except creating, dropping, and modifying databases, as well as managing transactions.
181182
. To list all privileges for the role `customAdministrator` as commands, use the following query:
182183
+
183184
[source, cypher, role=noplay]
@@ -195,6 +196,37 @@ SHOW ROLE customAdministrator PRIVILEGES AS COMMANDS
195196
a|Rows: 3
196197
|===
197198

199+
===
200+
201+
CREATE ROLE newRole AS COPY OF admin and then revoke the ability to read/write/load data?
202+
203+
[source, cypher, role=noplay]
204+
----
205+
CREATE ROLE newRole AS COPY OF admin;
206+
REVOKE GRANT MATCH {*} ON GRAPH * NODE * FROM newRole;
207+
REVOKE GRANT MATCH {*} ON GRAPH * RELATIONSHIP * FROM newRole;
208+
REVOKE GRANT WRITE ON GRAPH * FROM newRole;
209+
REVOKE GRANT LOAD ON ALL DATA FROM newRole;
210+
----
211+
212+
potentially also remove the index/constraint/name management
213+
214+
[source, cypher, role=noplay]
215+
----
216+
REVOKE GRANT CONSTRAINT MANAGEMENT ON DATABASE * FROM newRole;
217+
REVOKE GRANT INDEX MANAGEMENT ON DATABASE * FROM newRole;
218+
REVOKE GRANT NAME MANAGEMENT ON DATABASE * FROM newRole;
219+
REVOKE GRANT SHOW CONSTRAINT ON DATABASE * FROM newRole;
220+
REVOKE GRANT SHOW INDEX ON DATABASE * FROM newRole;
221+
----
222+
223+
If you want to be fancy we could also change what they have access on to system only:
224+
225+
[source, cypher, role=noplay]
226+
----
227+
REVOKE GRANT ACCESS ON DATABASE * FROM newRole;
228+
GRANT ACCESS ON DATABASE system TO newRole;
229+
----
198230

199231
[[access-control-dbms-administration-role-management]]
200232
== The DBMS `ROLE MANAGEMENT` privileges
@@ -335,7 +367,7 @@ a|Rows: 1
335367

336368
=== Grant privilege to assign roles
337369

338-
You can grant the privilege to assign roles using the `ASSIGN ROLE` privilege.
370+
You can grant the privilege to assign roles to users using the `ASSIGN ROLE` privilege.
339371
For example:
340372

341373
[source, cypher, role=noplay]
@@ -361,7 +393,7 @@ a|Rows: 1
361393

362394
=== Grant privilege to remove roles
363395

364-
You can grant the privilege to remove roles using the `REMOVE ROLE` privilege.
396+
You can grant the privilege to remove roles from users using the `REMOVE ROLE` privilege.
365397
For example:
366398

367399
[source, cypher, role=noplay]
@@ -390,13 +422,13 @@ a|Rows: 1
390422
You can grant the privilege to show roles using the `SHOW ROLE` privilege.
391423
A role with this privilege is allowed to execute the `SHOW ROLES` and `SHOW POPULATED ROLES` administration commands.
392424

393-
The following query shows an example of how to grant the `SHOW ROLE` privilege:
394-
395425
[NOTE]
396426
====
397427
In order to use `SHOW ROLES WITH USERS` and `SHOW POPULATED ROLES WITH USERS` administration commands, both the `SHOW ROLE` and the `SHOW USER` privileges are required.
398428
====
399429

430+
The following query shows an example of how to grant the `SHOW ROLE` privilege:
431+
400432
[source, cypher, role=noplay]
401433
----
402434
GRANT SHOW ROLE ON DBMS TO roleShower
@@ -635,18 +667,31 @@ SHOW ROLE passwordModifier PRIVILEGES AS COMMANDS
635667
a|Rows: 1
636668
|===
637669

638-
The `SET PASSWORDS` privilege allows the user to run the `ALTER USER` administration command with one or both of the `SET PASSWORD` and `SET PASSWORD CHANGE [NOT] REQUIRED` parts.
670+
The `SET PASSWORDS` privilege allows you to run the `ALTER USER` administration command with one or both of the `SET PASSWORD` and `SET PASSWORD CHANGE [NOT] REQUIRED` parts.
639671

640672
[source, cypher, role=noplay]
641673
----
642674
ALTER USER jake SET PASSWORD 'abcd5678' CHANGE NOT REQUIRED
643675
----
644676

645-
A user that is granted the `SET AUTH` privilege is allowed to run the `ALTER USER` administration command with one or both of the `SET AUTH` and `REMOVE AUTH` parts:
677+
=== Grant privilege to modify users' auth providers
678+
679+
You can grant the privilege to modify users' auth providers using the `SET AUTH` privilege.
680+
For example:
681+
682+
[source, cypher, role=noplay]
683+
----
684+
GRANT SET AUTH ON DBMS TO userModifier
685+
----
686+
As a result, the `userModifier` role has privileges that only allow modifying users' auth providers.
687+
688+
The `SET AUTH` privilege allows the user to run the `ALTER USER` administration command with one or both of the `SET
689+
AUTH` and `REMOVE AUTH` parts.
690+
For example:
646691

647692
[source, cypher, role=noplay]
648693
----
649-
ALTER USER jake REMOVE AUTH 'native SET AUTH 'oidc-okta' { SET id 'jakesUniqueOktaUserId' }
694+
ALTER USER jake REMOVE AUTH 'native' SET AUTH 'oidc-okta' { SET id 'jakesUniqueOktaUserId' }
650695
----
651696

652697
=== Grant privilege to modify the account status of users
@@ -675,7 +720,7 @@ SHOW ROLE statusModifier PRIVILEGES AS COMMANDS
675720
a|Rows: 1
676721
|===
677722

678-
A user that is granted the `SET USER STATUS` privilege is allowed to run the `ALTER USER` administration command with only the `SET STATUS` part:
723+
The `SET USER STATUS` privilege allows the user to run the `ALTER USER` administration command with only the `SET STATUS` part:
679724

680725
[source, cypher, role=noplay]
681726
----
@@ -709,7 +754,7 @@ SHOW ROLE statusModifier PRIVILEGES AS COMMANDS
709754
a|Rows: 2
710755
|===
711756

712-
A user that is granted the `SET USER HOME DATABASE` privilege is allowed to run the `ALTER USER` administration command with only the `SET HOME DATABASE` or `REMOVE HOME DATABASE` part:
757+
The `SET USER HOME DATABASE` privilege allows you to run the `ALTER USER` administration command with only the `SET HOME DATABASE` or `REMOVE HOME DATABASE` part:
713758

714759
[source, cypher, role=noplay]
715760
----

modules/ROOT/pages/database-administration/aliases/manage-aliases-standard-databases.adoc

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,14 @@ If a transaction modifies a database alias, other transactions concurrently exec
1313
This prevents issues such as a transaction executing against multiple target databases for the same alias.
1414
====
1515

16-
When a query is run against a database alias, it will be redirected to the target database.
17-
The home database for users can be set to an alias, which will be resolved to the target database on use.
18-
Starting with Neo4j 2025.04, a database alias can also be set as the default database.
19-
20-
This page describes managing database aliases for standard databases.
21-
For aliases created as part of a xref:database-administration/composite-databases/concepts.adoc[composite database], see xref:database-administration/aliases/manage-aliases-composite-databases.adoc[].
22-
2316
There are two kinds of database aliases - local and remote:
2417

2518
Local database aliases::
2619
A local database alias can only target a database within the same DBMS.
2720
It can be used in all Cypher commands in place of the target database.
2821
Please note that the local database alias will be resolved while executing the command.
2922
Privileges are defined on the target database, and not the local database alias.
30-
+
31-
[NOTE]
32-
====
33-
Starting with Neo4j 2025.06, a database can be assigned a default Cypher version.
34-
However, local database aliases cannot be assigned a default Cypher version.
35-
They always get the Cypher version of their target database.
36-
====
23+
3724

3825
Remote database aliases::
3926
A remote database alias may target a database from another Neo4j DBMS.
@@ -45,7 +32,20 @@ It can be used for:
4532
+
4633
Remote database aliases require configuration to safely connect to the remote target, which is described in xref::database-administration/aliases/remote-database-alias-configuration.adoc[Connecting remote databases].
4734
It is not possible to impersonate a user on the remote database or to execute an administration command on the remote database via a remote database alias.
48-
Starting with Neo4j 2025.06, a remote database alias can be assigned a default Cypher version.
35+
36+
[NOTE]
37+
====
38+
Starting with Neo4j 2025.06, a database or remote alias can be assigned a default Cypher version.
39+
However, local database aliases cannot be assigned a default Cypher version.
40+
They always get the Cypher version of their target database.
41+
====
42+
43+
When a query is run against a database alias, it will be redirected to the target database.
44+
The home database for users can be set to an alias, which will be resolved to the target database on use.
45+
Starting with Neo4j 2025.04, a database alias can also be set as the DBMS default database.
46+
47+
This page describes managing database aliases for standard databases.
48+
For aliases created as part of a xref:database-administration/composite-databases/concepts.adoc[composite database], see xref:database-administration/aliases/manage-aliases-composite-databases.adoc[].
4949

5050
[[manage-aliases-list]]
5151
== List database aliases
@@ -74,7 +74,7 @@ DEFAULT LANGUAGE CYPHER 25;
7474
////
7575

7676
You can list all available database aliases using the `SHOW ALIASES FOR DATABASE` command.
77-
The command returns a table of all standard and composite database aliases. +
77+
The command returns a table of all database aliases, whether they belong to a composite database or not. +
7878
If you need more details, you can append the command with `YIELD *`.
7979
The `YIELD *` clause returns the full set of columns.
8080
The required privileges are described in the xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-alias-management[The DBMS ALIAS MANAGEMENT privileges].
@@ -337,7 +337,7 @@ CREATE OR REPLACE ALIAS `northwind` FOR DATABASE `northwind-graph-2021`
337337
----
338338
+
339339
This is equivalent to running ```DROP ALIAS `northwind++` IF EXISTS FOR DATABASE++``` followed by ```CREATE ALIAS `northwind++` FOR DATABASE `northwind-graph-2021++````.
340-
+
340+
341341
[NOTE]
342342
====
343343
The `IF NOT EXISTS` and `OR REPLACE` parts of these commands cannot be used together.
@@ -384,6 +384,8 @@ See xref:database-administration/aliases/remote-database-alias-configuration.ado
384384

385385
Since remote database aliases target databases that are not in this DBMS, they do not fetch the default Cypher version from their target like the local database aliases.
386386
Instead, they are assigned the version given by xref:configuration/configuration-settings.adoc#config_db.query.default_language[`db.query.default_language`], which is set in the `neo4j.conf` file.
387+
Alternatively, you can specify the version in the `CREATE ALIAS` or `ALTER ALIAS` commands.
388+
See xref:database-administration/aliases/manage-aliases-standard-databases.adoc#set-default-language-for-remote-database-aliases[] and xref:database-administration/aliases/manage-aliases-standard-databases.adoc#alter-default-language-remote-database-alias[] for more information.
387389

388390
.Query
389391
[source, cypher]
@@ -429,7 +431,7 @@ If `ssl_enforced` is set to true, a secure URL scheme is enforced.
429431
It is be validated when the command is executed.
430432
* `connection_timeout` (For details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.connection.connect_timeout[dbms.routing.driver.connection.connect_timeout].)
431433
* `connection_max_lifetime` (For details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.connection.max_lifetime[dbms.routing.driver.connection.max_lifetime].)
432-
* `connection_pool_acquisition_timeout` (Foror details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.connection_pool_acquisition_timeout[dbms.routing.driver.connection_pool_acquisition_timeout].)
434+
* `connection_pool_acquisition_timeout` (For details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.connection_pool_acquisition_timeout[dbms.routing.driver.connection_pool_acquisition_timeout].)
433435
* `connection_pool_idle_test` (For details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.connection_pool_idle_test[dbms.routing.driver.connection_pool_idle_test].)
434436
* `connection_pool_max_size` (For details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.connection.pool.max_size[dbms.routing.driver.connection.pool.max_size].)
435437
* `logging_level` (For details, see xref:configuration/configuration-settings.adoc#config_dbms.routing.driver.logging.level[dbms.routing.driver.logging.level].)
@@ -470,6 +472,7 @@ SHOW ALIAS `remote-with-driver-settings` FOR DATABASE YIELD *
470472
----
471473

472474
[role=label--new-2025.06]
475+
[[set-default-language-for-remote-database-aliases]]
473476
==== Set a default Cypher version for remote database aliases
474477

475478
You can set a default Cypher version for remote database aliases using the `DEFAULT LANGUAGE` clause of the `CREATE ALIAS` or `ALTER ALIAS` commands.
@@ -539,7 +542,8 @@ SHOW ALIAS `remote-northwind-2021` FOR DATABASE YIELD name, properties
539542
== Alter database aliases
540543

541544
You can alter both local and remote database aliases using the `ALTER ALIAS` command.
542-
The command allows you to change the target database, properties, URL, user credentials, default language, or driver settings of the database alias.
545+
For all aliases, the command allows you to change the target database and properties of the database alias.
546+
For remote aliases, the command also allows you to change the URL, user credentials, default language, or driver settings of the database alias.
543547
The required privileges are described in the xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-alias-management[The DBMS ALIAS MANAGEMENT privileges].
544548
Only the clauses used will be altered.
545549

@@ -561,7 +565,7 @@ SET DATABASE TARGET `northwind-graph-2021`
561565
----
562566

563567
To verify that the local database alias has a new target database, you can use the `SHOW DATABASE` command.
564-
568+
It shows up in the `aliases` column for the target database.
565569
.Query
566570
[source, cypher]
567571
----
@@ -587,25 +591,26 @@ For example:
587591
.Query
588592
[source, cypher]
589593
----
590-
ALTER ALIAS `remote-northwind` SET DATABASE
591-
TARGET `northwind-graph-2020` AT "neo4j+s://other-location:7687"
594+
ALTER ALIAS `remote-northwind`
595+
SET DATABASE TARGET `northwind-graph-2020` AT "neo4j+s://other-location:7687"
592596
----
593597

594598
=== Alter a remote database alias credentials and driver settings
595599

596-
You can change the user credentials and driver settings of a remote database alias using the `USER`, `PASSWORD`, and `DRIVER` clauses of the `ALTER ALIAS` command.
600+
You can change the user credentials and driver settings of a remote database alias using the `USER`, `PASSWORD`, and `DRIVER` subclauses of the `SET DATABASE` clause of the `ALTER ALIAS` command.
597601
For example:
598602

599603
.Query
600604
[source, cypher]
601605
----
602-
ALTER ALIAS `remote-with-driver-settings` SET DATABASE
603-
USER bob
604-
PASSWORD 'new_example_secret'
605-
DRIVER {
606-
connection_timeout: duration({ minutes: 1}),
607-
logging_level: 'debug'
608-
}
606+
ALTER ALIAS `remote-with-driver-settings`
607+
SET DATABASE
608+
USER bob
609+
PASSWORD 'new_example_secret'
610+
DRIVER {
611+
connection_timeout: duration({ minutes: 1}),
612+
logging_level: 'debug'
613+
}
609614
----
610615

611616
[IMPORTANT]
@@ -626,16 +631,17 @@ DRIVER {}
626631
----
627632

628633
[role=label--new-2025.06]
634+
[[alter-default-language-remote-database-alias]]
629635
=== Alter the default Cypher version of a remote database alias
630636

631-
You can alter the default Cypher version of a remote database alias using the `DEFAULT LANGUAGE` clause of the `ALTER ALIAS` command.
637+
You can alter the default Cypher version of a remote database alias using the `SET DATABASE DEFAULT LANGUAGE` clause of the `ALTER ALIAS` command.
632638
For example:
633639

634640
.Query
635641
[source, cypher]
636642
----
637-
ALTER ALIAS `remote-with-default-language` SET DATABASE
638-
DEFAULT LANGUAGE CYPHER 5
643+
ALTER ALIAS `remote-with-default-language`
644+
SET DATABASE DEFAULT LANGUAGE CYPHER 5
639645
----
640646

641647
=== Alter properties of local and remote database aliases
@@ -691,7 +697,7 @@ For example:
691697
DROP ALIAS `northwind` FOR DATABASE
692698
----
693699

694-
To verify that the local database alias has been deleted, you can use the `SHOW ALIASES FOR DATABASE` command.
700+
To verify that the local database alias has been deleted, you can use the `SHOW DATABASES` command.
695701
The deleted alias will no longer appear in the `aliases` column.
696702

697703
.Query

modules/ROOT/pages/database-administration/index.adoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ The DBMS can manage a standalone server, or a group of servers in a cluster.
88

99
A database is an administrative partition of a DBMS.
1010
In practical terms, it is a physical structure of files organized within a directory or folder, that has the same name of the database.
11-
This chapter describes how to manage local and remote standard databases, composite databases, and database aliases.
11+
12+
This chapter describes how to manage local and remote standard databases, composite databases, and database aliases. +
13+
All databases are managed using the Cypher administration commands.
14+
For more information on the Cypher administration commands syntax, see xref:database-administration/syntax.adoc[Database management command syntax].
15+
16+
[WARNING]
17+
====
18+
Cypher administration commands must not be used during a rolling upgrade.
19+
For more information, see link:{neo4j-docs-base-uri}/upgrade-migration-guide/upgrade/upgrade-4.4/causal-cluster/[Upgrade and Migration Guide -> Upgrade a cluster].
20+
====
1221

1322
== Standard databases
1423

modules/ROOT/pages/database-administration/standard-databases/alter-databases.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You can modify standard databases using the Cypher command `ALTER DATABASE`.
88

99
[.tabbed-example]
1010
=====
11-
[role=include-with-cypher-5]
11+
[role=include-with-cypher-5 label--before-2025.06]
1212
======
1313
[options="header", width="100%", cols="1m,5a"]
1414
|===
@@ -22,7 +22,7 @@ ALTER DATABASE name [IF EXISTS]
2222
{
2323
SET ACCESS {READ ONLY \| READ WRITE} \|
2424
SET TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}] \|
25-
SET OPTION option value \|
25+
SET OPTION option value
2626
}
2727
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
2828
----
@@ -133,7 +133,7 @@ SET ACCESS READ WRITE
133133

134134
[role=label--new-2025.06]
135135
[[alter-database-default-language]]
136-
== Alter database default language
136+
== Alter database default Cypher version
137137

138138
You can change the default Cypher version of an existing database, including the `system` database, using the `ALTER DATABASE` command with the `SET DEFAULT LANGUAGE` clause.
139139
For example:
@@ -168,7 +168,7 @@ For more information, see xref::clustering/databases.adoc#alter-topology[Managin
168168

169169
[role=label--enterprise-edition label--not-on-aura]
170170
[[alter-database-options]]
171-
== `ALTER DATABASE` options
171+
== Alter database options
172172

173173
The `ALTER DATABASE` command can be used to set or remove specific options for a database.
174174

0 commit comments

Comments
 (0)