Skip to content

Commit e063cb5

Browse files
Hunternessrenetapopova
authored andcommitted
Show columns clarifications (#1826)
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.
1 parent a679447 commit e063cb5

File tree

2 files changed

+59
-15
lines changed

2 files changed

+59
-15
lines changed

modules/ROOT/pages/authentication-authorization/manage-privileges.adoc

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,29 @@ Other users' privileges cannot be listed when using a non-native auth provider.
438438

439439
When using the `RETURN` clause, the `YIELD` clause is mandatory and must not be omitted.
440440

441-
For an easy overview of the existing privileges, it is recommended to use the `AS COMMANDS` version of the `SHOW` command.
442-
This returns the column `command` of type `STRING` containing the privileges as the commands that are granted or denied.
441+
For an easy overview of the existing privileges, it is recommended to use the `AS COMMANDS` version of the `SHOW` command, which returns two columns.
443442

444-
When omitting the `AS COMMANDS` clause, results will include multiple columns describing privileges:
443+
.`SHOW PRIVILEGES AS COMMANDS` output
444+
[options="header", width="100%", cols="2a,4,2m"]
445+
|===
446+
| Column
447+
| Description
448+
| Type
449+
450+
| command
451+
| The privilege as the command that is granted or denied.
452+
Or in the `AS REVOKE COMMANDS` case, the command to revoke the privilege. label:default-output[]
453+
| STRING
445454

455+
| immutable
456+
| Whether or not the privilege is immutable.
457+
| BOOLEAN
458+
|===
459+
460+
Alternatively, you can omit the `AS COMMANDS` clause and get the full details of the privileges returned in multiple columns.
461+
They are all returned by default without requiring a `YIELD`.
462+
463+
.`SHOW PRIVILEGES` output
446464
[options="header", width="100%", cols="4m,6a,2m"]
447465
|===
448466
| Column | Description | Type
@@ -475,8 +493,6 @@ E.g., the entire DBMS, a specific database, a graph, or sub-graph access.
475493

476494
| immutable
477495
| Whether or not the privilege is immutable.
478-
479-
This column is also available for the `AS COMMAND` variant using `YIELD`.
480496
| BOOLEAN
481497

482498
| user

modules/ROOT/pages/authentication-authorization/manage-roles.adoc

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Lists the privileges granted to the specified roles.
131131

132132
When using the `RETURN` clause, the `YIELD` clause is mandatory and must not be omitted.
133133

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].
135135

136136
| Required privilege
137137
a|
@@ -339,9 +339,22 @@ For more information, see xref:authentication-authorization/dbms-administration.
339339
== Listing roles
340340

341341

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.
344343

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+
====
345358
[source, cypher, role=noplay]
346359
----
347360
SHOW ROLES
@@ -363,6 +376,7 @@ This is the same command as `SHOW ALL ROLES`.
363376
364377
1+a|Rows: 6
365378
|===
379+
====
366380

367381
When first starting a Neo4j DBMS, there are a number of built-in roles:
368382

@@ -379,9 +393,24 @@ More information about the built-in roles and their privileges can be found in x
379393
There are multiple versions of this command, the default being `SHOW ALL ROLES`.
380394
To only show roles that are assigned to users, the command is `SHOW POPULATED ROLES`.
381395
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
384404

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+
====
385414
[source, cypher, role=noplay]
386415
----
387416
SHOW POPULATED ROLES WITH USERS
@@ -415,9 +444,12 @@ The table of results will show information about the role and what database it b
415444
416445
2+a|Rows: 6
417446
|===
447+
====
418448

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`.
420450

451+
.Show roles with ordering and filtering
452+
====
421453
[source, cypher, role=noplay]
422454
----
423455
SHOW ROLES YIELD role
@@ -443,10 +475,6 @@ It is also possible to use `SKIP` and `LIMIT` to paginate the results.
443475
444476
1+a|Rows: 3
445477
|===
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].
450478
====
451479

452480

0 commit comments

Comments
 (0)