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
Update the column information to not just be in the text but as proper
tables for the 2 show commands that didn't have them as tables already.
Cherry-picked from #1826
Co-authored-by: Therese Magnusson <[email protected]>
Copy file name to clipboardExpand all lines: modules/ROOT/pages/authentication-authorization/manage-roles.adoc
+38-10Lines changed: 38 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ Lists the privileges granted to the specified roles.
131
131
132
132
When using the `RETURN` clause, the `YIELD` clause is mandatory and must not be omitted.
133
133
134
-
For more information, see xref:authentication-authorization/manage-privileges.adoc#access-control-list-privileges[Listing privileges].
134
+
The `SHOW ROLE name PRIVILEGES` command is described in xref:authentication-authorization/manage-privileges.adoc#access-control-list-privileges[Listing privileges].
135
135
136
136
| Required privilege
137
137
a|
@@ -339,9 +339,22 @@ For more information, see xref:authentication-authorization/dbms-administration.
339
339
== Listing roles
340
340
341
341
342
-
Available roles can be seen using `SHOW ROLES`.
343
-
This returns a single column `role` of type `STRING`, containing the role name.
342
+
You can view all available roles using the Cypher command `SHOW ROLES`, which returns a single column.
344
343
344
+
.`SHOW ROLES` output
345
+
[options="header", width="100%", cols="2a,4,2m"]
346
+
|===
347
+
| Column
348
+
| Description
349
+
| Type
350
+
351
+
| role
352
+
| Role name
353
+
| STRING
354
+
|===
355
+
356
+
.List all roles
357
+
====
345
358
[source, cypher, role=noplay]
346
359
----
347
360
SHOW ROLES
@@ -363,6 +376,7 @@ This is the same command as `SHOW ALL ROLES`.
363
376
364
377
1+a|Rows: 6
365
378
|===
379
+
====
366
380
367
381
When first starting a Neo4j DBMS, there are a number of built-in roles:
368
382
@@ -379,9 +393,24 @@ More information about the built-in roles and their privileges can be found in x
379
393
There are multiple versions of this command, the default being `SHOW ALL ROLES`.
380
394
To only show roles that are assigned to users, the command is `SHOW POPULATED ROLES`.
381
395
To see which users are assigned to which roles, `WITH USERS` can be added to the command.
382
-
This will return an additional `STRING` column, `member`, containing the username.
383
-
Since this gives a result with one row for each user, if a role is assigned to two users it will show up twice.
396
+
The command produces a row per role per user and yields the following column in addition to the one output by `SHOW ROLES`:
397
+
398
+
.`SHOW POPULATED ROLES WITH USERS` output
399
+
[options="header", width="100%", cols="2a,4,2m"]
400
+
|===
401
+
| Column
402
+
| Description
403
+
| Type
384
404
405
+
| member
406
+
| User name
407
+
| STRING
408
+
|===
409
+
410
+
Since this gives a result with one row for each user, it shows up twice if a role is assigned to two users.
411
+
412
+
.Show roles with users
413
+
====
385
414
[source, cypher, role=noplay]
386
415
----
387
416
SHOW POPULATED ROLES WITH USERS
@@ -415,9 +444,12 @@ The table of results will show information about the role and what database it b
415
444
416
445
2+a|Rows: 6
417
446
|===
447
+
====
418
448
419
-
It is also possible to filter and sort the results by using `YIELD`, `ORDER BY` and `WHERE`:
449
+
It is also possible to filter and sort the results by using `YIELD`, `ORDER BY` and `WHERE`.
420
450
451
+
.Show roles with ordering and filtering
452
+
====
421
453
[source, cypher, role=noplay]
422
454
----
423
455
SHOW ROLES YIELD role
@@ -443,10 +475,6 @@ It is also possible to use `SKIP` and `LIMIT` to paginate the results.
443
475
444
476
1+a|Rows: 3
445
477
|===
446
-
447
-
[NOTE]
448
-
====
449
-
The `SHOW ROLE name PRIVILEGES` command is found in xref:authentication-authorization/manage-privileges.adoc#access-control-list-privileges[Listing privileges].
0 commit comments