Skip to content

COPS-569: Show users and roles as commands - #3245

Open
OliviaYtterbrink wants to merge 3 commits into
neo4j:devfrom
OliviaYtterbrink:dev-show-as-commands
Open

COPS-569: Show users and roles as commands#3245
OliviaYtterbrink wants to merge 3 commits into
neo4j:devfrom
OliviaYtterbrink:dev-show-as-commands

Conversation

@OliviaYtterbrink

@OliviaYtterbrink OliviaYtterbrink commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Goes hand-in-hand with neo4j/docs-cypher#1638

@renetapopova renetapopova left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much, @OliviaYtterbrink! I added some editorial comments and suggestions.

Comment thread modules/ROOT/pages/authentication-authorization/manage-roles.adoc Outdated
Comment thread modules/ROOT/pages/authentication-authorization/manage-roles.adoc Outdated
Comment thread modules/ROOT/pages/authentication-authorization/manage-roles.adoc Outdated
Comment thread modules/ROOT/pages/authentication-authorization/manage-roles.adoc
Comment thread modules/ROOT/pages/authentication-authorization/manage-users.adoc Outdated
Comment thread modules/ROOT/pages/authentication-authorization/manage-users.adoc
Comment thread modules/ROOT/pages/authentication-authorization/manage-users.adoc Outdated
Comment thread modules/ROOT/pages/authentication-authorization/manage-users.adoc
@Hunterness Hunterness self-assigned this Aug 20, 2026
@neo4j-docops-agent

Copy link
Copy Markdown
Collaborator

This PR includes documentation updates
View the updated docs at https://neo4j-docs-operations-3245.surge.sh

Updated pages:


[source, cypher, role=noplay]
----
SHOW ROLES WITH AUTH RULES AS COMMANDS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SHOW ROLES WITH AUTH RULES AS COMMANDS
SHOW ROLES WITH AUTH RULES AS COMMANDS;

@renetapopova renetapopova left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me—just one missing semi-colon.

@Hunterness Hunterness left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments

@@ -392,7 +398,7 @@ a|Rows: 1

== Grant privilege to show users

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want a section like this for the show users as commands? or at least add a sentence in this section that for the AS COMMANDS variant you need SHOW USER CREDENTIALS?

| Enables the specified roles to list users.

| [source, syntax, role=noheader]
GRANT [IMMUTABLE] SHOW USER CREDENTIAL[S]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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

label:new[Introduced in 2026.08] When using the `AS COMMAND` clause, the result will be the commands to assign the users to the roles.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also want to mention here that it is an implicit POPULATED by users filter?


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

label:new[Introduced in 2026.08] When using the `AS COMMAND` clause, the result will be the commands to assign the auth rules to the roles.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also want to mention here that it is an implicit POPULATED by auth rules filter?

Comment on lines +629 to +630
The command produces a row per role per user and yields a member column, in addition to the one returned by `SHOW ROLES AS COMMANDS`, containing the name of the user assigned to the role.
If a role is assigned to multiple users, it will appear once for each user, and if it is assigned to no users, it will not appear at all.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To also cover the YIELD * behaviour.

Suggested change
The command produces a row per role per user and yields a member column, in addition to the one returned by `SHOW ROLES AS COMMANDS`, containing the name of the user assigned to the role.
If a role is assigned to multiple users, it will appear once for each user, and if it is assigned to no users, it will not appear at all.
The command produces a row per role per user and yields a member column, in addition to the ones returned by `SHOW ROLES AS COMMANDS`, containing the name of the user assigned to the role.
The `member` column is returned by default.
If a role is assigned to multiple users, it will appear once for each user, and if it is assigned to no users, it will not appear at all.

| BOOLEAN
|===

=== Showing all roles as commands

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=== Showing all roles as commands
=== Showing create role commands

+-------------------------+
----

=== Showing roles with users as commands

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=== Showing roles with users as commands
=== Showing assign user to role commands

+--------------------------------------------+
----

=== Showing roles with auth rules as commands

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=== Showing roles with auth rules as commands
=== Showing assign auth rule to role commands

[role=label--new-2026.08 label--cypher-25]
== Showing users as commands

To get the commands to create users, use SHOW USERS AS COMMANDS. The command produces a row per user and yields the following column:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you also show which columns are returned with YIELD *? as I think you have two in the CIP and three in the implementation that is yield-only columns...


[[access-control-list-user-as-commands]]
[role=label--new-2026.08 label--cypher-25]
== Showing users as commands

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware of clashes with #3206 as that one moves things around in manage-users, so as to not get a weird order when both are merged

and that PR also updates some of the examples and what users are available at this point so these examples might need to be updated as well to match

(I guess it is on whichever of the two that goes in last to do such updates)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2026.08 team-cypher-operations Cypher operations should review this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants