You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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
115
117
+
116
118
[source, cypher, role=noplay]
117
119
----
118
-
CREATE ROLE usermanager;
120
+
CREATE ROLE userManager;
119
121
----
120
122
. Grant the privilege to manage users:
121
123
+
122
124
[source, cypher, role=noplay]
123
125
----
124
-
GRANT USER MANAGEMENT ON DBMS TO usermanager;
126
+
GRANT USER MANAGEMENT ON DBMS TO userManager;
125
127
----
126
128
. Grant the privilege to manage roles:
127
129
+
128
130
[source, cypher, role=noplay]
129
131
----
130
-
GRANT ROLE MANAGEMENT ON DBMS TO usermanager;
132
+
GRANT ROLE MANAGEMENT ON DBMS TO userManager;
131
133
----
132
134
+
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:
135
137
+
136
138
[source, cypher, role=noplay]
137
139
----
138
-
SHOW ROLE usermanager PRIVILEGES AS COMMANDS;
140
+
SHOW ROLE userManager PRIVILEGES AS COMMANDS;
139
141
----
140
142
+
141
143
.Result
142
144
[options="header,footer", width="100%", cols="m"]
143
145
|===
144
146
|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`"
147
149
a|Rows: 2
148
150
|===
149
151
@@ -206,65 +208,65 @@ a|Rows: 3
206
208
=== Create a custom administrator role by copying the `admin` role
207
209
208
210
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.
210
212
211
213
. Create a new role by copying the `admin` role:
212
214
+
213
215
[source, cypher, role=noplay]
214
216
----
215
-
CREATE ROLE newRole AS COPY OF admin;
217
+
CREATE ROLE newAdministrator AS COPY OF admin;
216
218
----
217
219
218
220
. Revoke the ability to read/write/load data:
219
221
+
220
222
[source, cypher, role=noplay]
221
223
----
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;
226
228
----
227
229
228
230
. Revoke the ability to manage index/constraint/name:
229
231
+
230
232
[source, cypher, role=noplay]
231
233
----
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;
237
239
----
238
240
239
241
. Revoke the ability to access all databases:
240
242
+
241
243
[source, cypher, role=noplay]
242
244
----
243
-
REVOKE GRANT ACCESS ON DATABASE * FROM newRole;
245
+
REVOKE GRANT ACCESS ON DATABASE * FROM newAdministrator;
244
246
----
245
247
. Grant the ability to access the `system` database:
246
248
+
247
249
[source, cypher, role=noplay]
248
250
----
249
-
GRANT ACCESS ON DATABASE system TO newRole;
251
+
GRANT ACCESS ON DATABASE system TO newAdministrator;
250
252
----
251
253
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:
253
255
+
254
256
[source, cypher, role=noplay]
255
257
----
256
-
SHOW ROLE newRole PRIVILEGES AS COMMANDS;
258
+
SHOW ROLE newAdministrator PRIVILEGES AS COMMANDS;
257
259
----
258
260
+
259
261
.Result
260
262
[options="header,footer", width="100%", cols="m"]
261
263
|===
262
264
|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`"
268
270
a|Rows: 5
269
271
|===
270
272
@@ -728,7 +730,7 @@ For example:
728
730
----
729
731
GRANT SET AUTH ON DBMS TO authModifier
730
732
----
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.
732
734
733
735
The `SET AUTH` privilege allows the user to run the `ALTER USER` administration command with one or both of the `SET
734
736
AUTH` and `REMOVE AUTH` parts. +
@@ -779,23 +781,23 @@ For example:
779
781
780
782
[source, cypher, role=noplay]
781
783
----
782
-
GRANT SET USER HOME DATABASE ON DBMS TO statusModifier
784
+
GRANT SET USER HOME DATABASE ON DBMS TO homeDbModifier
783
785
----
784
786
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:
787
789
788
790
[source, cypher, role=noplay]
789
791
----
790
-
SHOW ROLE statusModifier PRIVILEGES AS COMMANDS;
792
+
SHOW ROLE homeDbModifier PRIVILEGES AS COMMANDS;
791
793
----
792
794
793
795
.Result
794
796
[options="header,footer", width="100%", cols="m"]
795
797
|===
796
798
|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`"
799
801
a|Rows: 2
800
802
|===
801
803
@@ -897,13 +899,13 @@ The DBMS privileges for impersonation can be granted, denied, or revoked like ot
897
899
898
900
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).
899
901
902
+
You can use the `IMPERSONATE` privilege to allow a user to impersonate another user.
903
+
900
904
[NOTE]
901
905
====
902
906
For more details about the syntax descriptions, see xref:database-administration/syntax.adoc#administration-syntax-reading[Reading the administration commands syntax].
903
907
====
904
908
905
-
You can use the `IMPERSONATE` privilege to allow a user to impersonate another user.
906
-
907
909
.Impersonation privileges command syntax
908
910
[options="header", width="100%", cols="3a,2"]
909
911
|===
@@ -958,7 +960,7 @@ For example:
958
960
.Query
959
961
[source, cypher, role=noplay]
960
962
----
961
-
GRANT IMPERSONATE (alice, bob) ON DBMS TO userImpersonator
963
+
GRANT IMPERSONATE (alice, bob) ON DBMS TO userImpersonator;
962
964
----
963
965
964
966
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`:
967
969
.Query
968
970
[source, cypher, role=noplay]
969
971
----
970
-
DENY IMPERSONATE (alice) ON DBMS TO userImpersonator
972
+
DENY IMPERSONATE (alice) ON DBMS TO userImpersonator;
971
973
----
972
974
973
975
As a result, the `userImpersonator` user would be able to impersonate only `bob`.
974
976
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`"
You can grant the privilege to modify composite databases using the `ALTER COMPOSITE DATABASE` privilege. +
@@ -1613,9 +1633,9 @@ GRANT [IMMUTABLE] PRIVILEGE MANAGEMENT
1613
1633
1614
1634
=== Grant privilege to list privileges
1615
1635
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
+
1619
1639
For example:
1620
1640
1621
1641
[source, cypher, role=noplay]
@@ -1857,7 +1877,7 @@ Both `EXECUTE PROCEDURE` and `EXECUTE BOOSTED PROCEDURE` are needed to execute a
1857
1877
1858
1878
You can grant the privilege to execute some procedures with elevated privileges using `EXECUTE BOOSTED PROCEDURE *`.
1859
1879
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:
1861
1881
1862
1882
[source, cypher, role=noplay]
1863
1883
----
@@ -1959,7 +1979,7 @@ a|Rows: 2
1959
1979
You can also grant the privilege to execute procedures with elevated privileges and deny the elevation for specific procedures.
1960
1980
1961
1981
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.
1963
1983
1964
1984
[source, cypher, role=noplay]
1965
1985
----
@@ -1995,7 +2015,7 @@ a|Rows: 2
1995
2015
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.
1996
2016
For example, assume there is a procedure called `myProc`.
1997
2017
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.
1999
2019
2000
2020
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.
2001
2021
@@ -2060,7 +2080,7 @@ A role with this privilege is allowed to execute the UDFs matched by the <<acces
2060
2080
2061
2081
[IMPORTANT]
2062
2082
====
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.
2064
2084
====
2065
2085
2066
2086
==== Execute user-defined function
@@ -2080,7 +2100,7 @@ GRANT EXECUTE FUNCTION apoc.coll.* ON DBMS TO functionExecutor
2080
2100
----
2081
2101
2082
2102
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.
2084
2104
2085
2105
As a result, the `functionExecutor` role has privileges that only allow executing UDFs in the `apoc.coll` namespace.
2086
2106
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;
2126
2146
----
2127
2147
2128
2148
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.
2130
2150
To list all privileges for the role `deniedFunctionExecutor` as commands, use the following query:
0 commit comments