Skip to content

DOCS-2278 use shell helpers instead of commands in final step #1453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions source/includes/steps-change-user-privileges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,31 @@ ref: user-modification
action:
- heading: Revoke a Role
pre: |
Revoke a role using the :dbcommand:`revokeRolesFromUser` command. For
example, to remove the :authrole:`readWrite` role on the ``accounts``
database from the user ``accountUser01``, use an operation that
resembles the following:

Revoke a role using the :method:`db.revokeRolesFromUser()` method. For
example, the following sequence of operations removes
:authrole:`readWrite` on the ``accounts`` database from
``accountUser01``'s existing roles:

language: javascript
code: |
use accounts
db.runCommand( { revokeRolesFromUser: "accountUser01",
roles: [ { role: "readWrite", db: "accounts" } ]
} )
post: |
The :dbcommand:`revokeRolesToUser` command removes the
:authrole:`readWrite` role on the ``accounts`` database from
``accountUser01``\ 's existing roles.
db.revokeRolesFromUser(
"accountUser01",
[ { role: "readWrite", db: "accounts" } ]
)
- heading: Grant a Role
pre: |
Grant the role using the :dbcommand:`grantRolesToUser` command. For example,
to grant the user ``accountUser01`` the :authrole:`read` role on
the ``records`` database, use an operation that resembles the following:

Grant a role using the :method:`db.grantRolesToUser()` method. For
example, the following sequence of operations grant ``accountUser01``
the :authrole:`read` role on the ``records`` database:

language: javascript
code: |
use accounts
db.runCommand( { grantRolesToUser: "accountUser01",
roles: [ { role: "read", db: "records" } ]
} )
post: |
The :dbcommand:`grantRolesToUser` command adds the ``read`` role on the
``records`` database to ``accountUser01``\ 's existing roles.
db.grantRolesToUser(
"accountUser01",
[ { role: "read", db: "records" } ]
)
...