Skip to content

Commit 294d81a

Browse files
committed
apply suggestion from review
1 parent c9cc0f1 commit 294d81a

File tree

1 file changed

+69
-49
lines changed

1 file changed

+69
-49
lines changed

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

Lines changed: 69 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ CREATE ROLE roleViewer IF NOT EXISTS;
1313
CREATE ROLE roleManager IF NOT EXISTS;
1414
CREATE ROLE userAdder IF NOT EXISTS;
1515
CREATE ROLE userNameModifier IF NOT EXISTS;
16+
CREATE ROLE homeDbModifier IF NOT EXISTS;
17+
CREATE ROLE allUserImpersonator IF NOT EXISTS;
1618
CREATE ROLE userModifier IF NOT EXISTS;
1719
CREATE ROLE passwordModifier IF NOT EXISTS;
1820
CREATE ROLE statusModifier IF NOT EXISTS;
@@ -90,7 +92,7 @@ These include:
9092
* Change configuration parameters.
9193
* xref:authentication-authorization/database-administration.adoc#access-control-database-administration-transaction[Manage transactions].
9294
* Manage <<access-control-dbms-administration-user-management, users>> and <<access-control-dbms-administration-role-management, roles>>.
93-
* Manage sub-graph <<access-control-dbms-administration-privilege-management, privileges>>.
95+
* Manage <<access-control-dbms-administration-privilege-management, privileges>>.
9496
* Manage <<access-control-dbms-administration-impersonation, impersonation privileges>>.
9597
* Manage <<access-control-dbms-administration-execute, procedure security>>.
9698
* Manage <<access-control-dbms-administration-load-privileges, load data security>>.
@@ -115,35 +117,35 @@ Create an administrator role that can only manage users and roles by creating a
115117
+
116118
[source, cypher, role=noplay]
117119
----
118-
CREATE ROLE usermanager;
120+
CREATE ROLE userManager;
119121
----
120122
. Grant the privilege to manage users:
121123
+
122124
[source, cypher, role=noplay]
123125
----
124-
GRANT USER MANAGEMENT ON DBMS TO usermanager;
126+
GRANT USER MANAGEMENT ON DBMS TO userManager;
125127
----
126128
. Grant the privilege to manage roles:
127129
+
128130
[source, cypher, role=noplay]
129131
----
130-
GRANT ROLE MANAGEMENT ON DBMS TO usermanager;
132+
GRANT ROLE MANAGEMENT ON DBMS TO userManager;
131133
----
132134
+
133-
As a result, the `usermanager` role has privileges that only allow user and role management.
134-
. To list all privileges for the role `usermanager` as commands, use the following query:
135+
As a result, the `userManager` role has privileges that only allow user and role management.
136+
. To list all privileges for the role `userManager` as commands, use the following query:
135137
+
136138
[source, cypher, role=noplay]
137139
----
138-
SHOW ROLE usermanager PRIVILEGES AS COMMANDS;
140+
SHOW ROLE userManager PRIVILEGES AS COMMANDS;
139141
----
140142
+
141143
.Result
142144
[options="header,footer", width="100%", cols="m"]
143145
|===
144146
|command
145-
|"GRANT ROLE MANAGEMENT ON DBMS TO `usermanager`"
146-
|"GRANT USER MANAGEMENT ON DBMS TO `usermanager`"
147+
|"GRANT ROLE MANAGEMENT ON DBMS TO `userManager`"
148+
|"GRANT USER MANAGEMENT ON DBMS TO `userManager`"
147149
a|Rows: 2
148150
|===
149151

@@ -206,65 +208,65 @@ a|Rows: 3
206208
=== Create a custom administrator role by copying the `admin` role
207209

208210
You can also create a custom administrator role by copying the `admin` role and then revoking or denying the privileges you do not want.
209-
For example, you can create a new role called `newRole` that has all the privileges of the `admin` role, and then revoke the ability to read/write/load data, manage constraints, indexes, name, and remove ability to access all databases, except the `system` database.
211+
For example, you can create a new role called `newAdministrator` that has all the privileges of the `admin` role, and then revoke the ability to read/write/load data, manage constraints, indexes, name, and remove ability to access all databases, except the `system` database.
210212

211213
. Create a new role by copying the `admin` role:
212214
+
213215
[source, cypher, role=noplay]
214216
----
215-
CREATE ROLE newRole AS COPY OF admin;
217+
CREATE ROLE newAdministrator AS COPY OF admin;
216218
----
217219

218220
. Revoke the ability to read/write/load data:
219221
+
220222
[source, cypher, role=noplay]
221223
----
222-
REVOKE GRANT MATCH {*} ON GRAPH * NODE * FROM newRole;
223-
REVOKE GRANT MATCH {*} ON GRAPH * RELATIONSHIP * FROM newRole;
224-
REVOKE GRANT WRITE ON GRAPH * FROM newRole;
225-
REVOKE GRANT LOAD ON ALL DATA FROM newRole;
224+
REVOKE GRANT MATCH {*} ON GRAPH * NODE * FROM newAdministrator;
225+
REVOKE GRANT MATCH {*} ON GRAPH * RELATIONSHIP * FROM newAdministrator;
226+
REVOKE GRANT WRITE ON GRAPH * FROM newAdministrator;
227+
REVOKE GRANT LOAD ON ALL DATA FROM newAdministrator;
226228
----
227229

228230
. Revoke the ability to manage index/constraint/name:
229231
+
230232
[source, cypher, role=noplay]
231233
----
232-
REVOKE GRANT CONSTRAINT MANAGEMENT ON DATABASE * FROM newRole;
233-
REVOKE GRANT INDEX MANAGEMENT ON DATABASE * FROM newRole;
234-
REVOKE GRANT NAME MANAGEMENT ON DATABASE * FROM newRole;
235-
REVOKE GRANT SHOW CONSTRAINT ON DATABASE * FROM newRole;
236-
REVOKE GRANT SHOW INDEX ON DATABASE * FROM newRole;
234+
REVOKE GRANT CONSTRAINT MANAGEMENT ON DATABASE * FROM newAdministrator;
235+
REVOKE GRANT INDEX MANAGEMENT ON DATABASE * FROM newAdministrator;
236+
REVOKE GRANT NAME MANAGEMENT ON DATABASE * FROM newAdministrator;
237+
REVOKE GRANT SHOW CONSTRAINT ON DATABASE * FROM newAdministrator;
238+
REVOKE GRANT SHOW INDEX ON DATABASE * FROM newAdministrator;
237239
----
238240

239241
. Revoke the ability to access all databases:
240242
+
241243
[source, cypher, role=noplay]
242244
----
243-
REVOKE GRANT ACCESS ON DATABASE * FROM newRole;
245+
REVOKE GRANT ACCESS ON DATABASE * FROM newAdministrator;
244246
----
245247
. Grant the ability to access the `system` database:
246248
+
247249
[source, cypher, role=noplay]
248250
----
249-
GRANT ACCESS ON DATABASE system TO newRole;
251+
GRANT ACCESS ON DATABASE system TO newAdministrator;
250252
----
251253

252-
. To list all privileges for the role `newRole` as commands, use the following query:
254+
. To list all privileges for the role `newAdministrator` as commands, use the following query:
253255
+
254256
[source, cypher, role=noplay]
255257
----
256-
SHOW ROLE newRole PRIVILEGES AS COMMANDS;
258+
SHOW ROLE newAdministrator PRIVILEGES AS COMMANDS;
257259
----
258260
+
259261
.Result
260262
[options="header,footer", width="100%", cols="m"]
261263
|===
262264
|command
263-
| "GRANT ACCESS ON DATABASE `system` TO `newRole`"
264-
| "GRANT ALL DBMS PRIVILEGES ON DBMS TO `newRole`"
265-
| "GRANT START ON DATABASE * TO `newRole`"
266-
| "GRANT STOP ON DATABASE * TO `newRole`"
267-
| "GRANT TRANSACTION MANAGEMENT (*) ON DATABASE * TO `newRole`"
265+
| "GRANT ACCESS ON DATABASE `system` TO `newAdministrator`"
266+
| "GRANT ALL DBMS PRIVILEGES ON DBMS TO `newAdministrator`"
267+
| "GRANT START ON DATABASE * TO `newAdministrator`"
268+
| "GRANT STOP ON DATABASE * TO `newAdministrator`"
269+
| "GRANT TRANSACTION MANAGEMENT (*) ON DATABASE * TO `newAdministrator`"
268270
a|Rows: 5
269271
|===
270272

@@ -728,7 +730,7 @@ For example:
728730
----
729731
GRANT SET AUTH ON DBMS TO authModifier
730732
----
731-
As a result, the `userModifier` role has privileges that only allow modifying users' auth providers.
733+
As a result, the `authModifier` role has privileges that only allow modifying users' auth information.
732734

733735
The `SET AUTH` privilege allows the user to run the `ALTER USER` administration command with one or both of the `SET
734736
AUTH` and `REMOVE AUTH` parts. +
@@ -779,23 +781,23 @@ For example:
779781

780782
[source, cypher, role=noplay]
781783
----
782-
GRANT SET USER HOME DATABASE ON DBMS TO statusModifier
784+
GRANT SET USER HOME DATABASE ON DBMS TO homeDbModifier
783785
----
784786

785-
As a result, the `statusModifier` role has privileges that only allow modifying the home database of users.
786-
To list all privileges for the role `statusModifier` as commands, use the following query:
787+
As a result, the `homeDbModifier` role has privileges that only allow modifying the home database of users.
788+
To list all privileges for the role `homeDbModifier` as commands, use the following query:
787789

788790
[source, cypher, role=noplay]
789791
----
790-
SHOW ROLE statusModifier PRIVILEGES AS COMMANDS;
792+
SHOW ROLE homeDbModifier PRIVILEGES AS COMMANDS;
791793
----
792794

793795
.Result
794796
[options="header,footer", width="100%", cols="m"]
795797
|===
796798
|command
797-
|"GRANT SET USER HOME DATABASE ON DBMS TO `statusModifier`"
798-
|"GRANT SET USER STATUS ON DBMS TO `statusModifier`"
799+
|"GRANT SET USER HOME DATABASE ON DBMS TO `homeDbModifier`"
800+
|"GRANT SET USER STATUS ON DBMS TO `homeDbModifier`"
799801
a|Rows: 2
800802
|===
801803

@@ -897,13 +899,13 @@ The DBMS privileges for impersonation can be granted, denied, or revoked like ot
897899

898900
Impersonation is the ability of a user to assume another user's roles (and therefore privileges), with the restriction of not being able to execute updating `admin` commands as the impersonated user (i.e. they would still be able to use `SHOW` commands).
899901

902+
You can use the `IMPERSONATE` privilege to allow a user to impersonate another user.
903+
900904
[NOTE]
901905
====
902906
For more details about the syntax descriptions, see xref:database-administration/syntax.adoc#administration-syntax-reading[Reading the administration commands syntax].
903907
====
904908

905-
You can use the `IMPERSONATE` privilege to allow a user to impersonate another user.
906-
907909
.Impersonation privileges command syntax
908910
[options="header", width="100%", cols="3a,2"]
909911
|===
@@ -958,7 +960,7 @@ For example:
958960
.Query
959961
[source, cypher, role=noplay]
960962
----
961-
GRANT IMPERSONATE (alice, bob) ON DBMS TO userImpersonator
963+
GRANT IMPERSONATE (alice, bob) ON DBMS TO userImpersonator;
962964
----
963965

964966
As a result, the `userImpersonator` role has privileges that allow impersonating only `alice` and `bob`.
@@ -967,11 +969,28 @@ Then, you deny the privilege to impersonate `alice`:
967969
.Query
968970
[source, cypher, role=noplay]
969971
----
970-
DENY IMPERSONATE (alice) ON DBMS TO userImpersonator
972+
DENY IMPERSONATE (alice) ON DBMS TO userImpersonator;
971973
----
972974

973975
As a result, the `userImpersonator` user would be able to impersonate only `bob`.
974976

977+
To list all privileges for the role `userImpersonator` as commands, use the following query:
978+
979+
.Query
980+
[source, cypher, role=noplay]
981+
----
982+
SHOW ROLE userImpersonator PRIVILEGES AS COMMANDS;
983+
----
984+
.Result
985+
[options="header,footer", width="100%", cols="m"]
986+
|===
987+
| command
988+
| "DENY IMPERSONATE (alice) ON DBMS TO `userImpersonator`"
989+
| "GRANT IMPERSONATE (alice) ON DBMS TO `userImpersonator`"
990+
| "GRANT IMPERSONATE (bob) ON DBMS TO `userImpersonator`"
991+
a|Rows: 3
992+
|===
993+
975994
[[access-control-dbms-administration-database-management]]
976995
== The DBMS `DATABASE MANAGEMENT` privileges
977996

@@ -1233,6 +1252,7 @@ a|Rows: 1
12331252
|===
12341253

12351254
[rol=label--new-2025.06]
1255+
[[grant-privilege-alter-composite-database]]
12361256
=== Grant privilege to modify composite databases
12371257

12381258
You can grant the privilege to modify composite databases using the `ALTER COMPOSITE DATABASE` privilege. +
@@ -1613,9 +1633,9 @@ GRANT [IMMUTABLE] PRIVILEGE MANAGEMENT
16131633

16141634
=== Grant privilege to list privileges
16151635

1616-
You can grant the privilege to list privileges using the `SHOW PRIVILEGE` privilege. +
1617-
A user with this privilege is allowed to execute the `SHOW PRIVILEGES` and `SHOW ROLE roleName PRIVILEGES` administration commands.
1618-
To execute the `SHOW USER username PRIVILEGES` administration command, both this privilege and the `SHOW USER` privilege are required. +
1636+
You can grant the `SHOW PRIVILEGE` privilege to allow a user to list privileges using the `SHOW PRIVILEGE`, `SHOW ROLE roleName PRIVILEGES`, and `SHOW USER username PRIVILEGES` administration commands.
1637+
The `SHOW USER username PRIVILEGES` command also requires the `SHOW USER` privilege.
1638+
16191639
For example:
16201640

16211641
[source, cypher, role=noplay]
@@ -1857,7 +1877,7 @@ Both `EXECUTE PROCEDURE` and `EXECUTE BOOSTED PROCEDURE` are needed to execute a
18571877

18581878
You can grant the privilege to execute some procedures with elevated privileges using `EXECUTE BOOSTED PROCEDURE *`.
18591879

1860-
For example, the following query allow the execution of all procedures and `db.labels` and `db.relationshipTypes` with elevated privileges, and all other procedures with the user's own privileges:
1880+
For example, the following query allow the execution of the procedures `db.labels` and `db.relationshipTypes` with elevated privileges, and all other procedures with the user's own privileges:
18611881

18621882
[source, cypher, role=noplay]
18631883
----
@@ -1959,7 +1979,7 @@ a|Rows: 2
19591979
You can also grant the privilege to execute procedures with elevated privileges and deny the elevation for specific procedures.
19601980

19611981
For example, the following queries allow has privileges that allow elevating the privileges for all procedures except `db.labels`.
1962-
However, no procedures can be executed due to a missing `EXECUTE BOOSTED PROCEDURE` privilege.
1982+
However, no procedures can be executed due to a missing `EXECUTE PROCEDURE` privilege.
19631983

19641984
[source, cypher, role=noplay]
19651985
----
@@ -1995,7 +2015,7 @@ a|Rows: 2
19952015
You can control the output of procedures based on the privileges granted or denied to a role using the `EXECUTE PROCEDURE` and `EXECUTE BOOSTED PROCEDURE` privileges.
19962016
For example, assume there is a procedure called `myProc`.
19972017

1998-
This procedure gives the result `A` and `B` for a user with `EXECUTE PROCEDURE` privilege and `A`, `B` and `C` for a user with `EXECUTE BOOSTED PROCEDURE` privilege.
2018+
This procedure gives the result `A` and `B` for a user with only the `EXECUTE PROCEDURE` privilege and `A`, `B` and `C` for a user with both the `EXECUTE PROCEDURE` and `EXECUTE BOOSTED PROCEDURE` privileges.
19992019

20002020
Now, adapt the privileges from sections <<grant-execute-procedure-deny-elevation, Combination of granting execution and denying privilege elevation>> (example 1), <<grant-privilege-elevation-deny-execution, Combination of granting privilege elevation and denying execution>> (example 2), and <<grant-deny-privilege-elevation, Combination of granting and denying privilege elevations>> (example 3) to be applied to this procedure and show what is returned.
20012021

@@ -2060,7 +2080,7 @@ A role with this privilege is allowed to execute the UDFs matched by the <<acces
20602080

20612081
[IMPORTANT]
20622082
====
2063-
The `EXECUTE USER DEFINED FUNCTION` privilege does not apply to built-in UDFs, which are always executable.
2083+
The `EXECUTE USER DEFINED FUNCTION` privilege does not apply to built-in functions, which are always executable.
20642084
====
20652085

20662086
==== Execute user-defined function
@@ -2080,7 +2100,7 @@ GRANT EXECUTE FUNCTION apoc.coll.* ON DBMS TO functionExecutor
20802100
----
20812101

20822102
Users with the role `functionExecutor` can thus run any UDF in the `apoc.coll` namespace.
2083-
The function is run using the user's own privileges.
2103+
The functions are executed using the user's own privileges.
20842104

20852105
As a result, the `functionExecutor` role has privileges that only allow executing UDFs in the `apoc.coll` namespace.
20862106
To list all privileges for the role `functionExecutor` as commands, use the following query:
@@ -2126,7 +2146,7 @@ DENY EXECUTE FUNCTION apoc.any.prop* ON DBMS TO deniedFunctionExecutor;
21262146
----
21272147

21282148
As a result, the `deniedFunctionExecutor` role has privileges that only allow the execution of all UDFs except those starting with `apoc.any.prop`.
2129-
The function is run using the user's own privileges.
2149+
The functions are executed using the user's own privileges.
21302150
To list all privileges for the role `deniedFunctionExecutor` as commands, use the following query:
21312151

21322152
[source, cypher, role=noplay]

0 commit comments

Comments
 (0)