Skip to content

Commit f01b2b5

Browse files
authored
DOCSP-27062 Adds Interlinks for mongosh Role Methods (#2275) (#2319)
1 parent 5e22141 commit f01b2b5

16 files changed

+55
-27
lines changed

source/reference/command/createRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Definition
2121
command returns a *duplicate role* error if the role already exists in
2222
the database.
2323

24+
.. |method| replace:: :method:`db.createRole` helper method
25+
.. include:: /includes/fact-dbcommand-tip
26+
2427
The :dbcommand:`createRole` command uses the following syntax:
2528

2629
.. code-block:: javascript

source/reference/command/dropAllRolesFromDatabase.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ Definition
2323
The :dbcommand:`dropAllRolesFromDatabase` removes *all*
2424
:ref:`user-defined <user-defined-roles>` roles from the database.
2525

26+
.. |method| replace:: :method:`db.dropAllRoles` helper method
27+
.. include:: /includes/fact-dbcommand-tip
28+
2629
The :dbcommand:`dropAllRolesFromDatabase` command takes the following
2730
form:
2831

32+
2933
.. code-block:: javascript
3034

3135
{

source/reference/command/dropRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Deletes a :ref:`user-defined <user-defined-roles>` role from the
1919
database on which you run the command.
2020

21+
.. |method| replace:: :method:`db.dropRole` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
2124
The :dbcommand:`dropRole` command uses the following syntax:
2225

2326
.. code-block:: javascript

source/reference/command/grantPrivilegesToRole.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ Definition
1717

1818
Assigns additional :ref:`privileges <privileges>` to a :ref:`user-defined
1919
<user-defined-roles>` role defined on the database on which the
20-
command is run. The :dbcommand:`grantPrivilegesToRole` command uses
21-
the following syntax:
20+
command is run.
21+
22+
.. |method| replace:: :method:`db.grantPrivilegesToRole` helper method
23+
.. include:: /includes/fact-dbcommand-tip
24+
25+
The :dbcommand:`grantPrivilegesToRole` command uses the following syntax:
2226

2327
.. code-block:: javascript
2428

source/reference/command/grantRolesToRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Grants roles to a :ref:`user-defined role <user-defined-roles>`.
1919

20+
.. |method| replace:: :method:`db.grantRolesToRole` helper method
21+
.. include:: /includes/fact-dbcommand-tip
22+
2023
The :dbcommand:`grantRolesToRole` command affects roles on the
2124
database where the command runs. :dbcommand:`grantRolesToRole` has
2225
the following syntax:

source/reference/command/revokePrivilegesFromRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Definition
2020
command is run. The :dbcommand:`revokePrivilegesFromRole` command
2121
has the following syntax:
2222

23+
.. |method| replace:: :method:`db.revokePrivilegesFromRole` helper method
24+
.. include:: /includes/fact-dbcommand-tip
25+
2326
.. code-block:: javascript
2427

2528
{

source/reference/command/revokeRolesFromRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Removes the specified inherited roles from a role. The
1919
:dbcommand:`revokeRolesFromRole` command has the following syntax:
2020

21+
.. |method| replace:: :method:`db.revokeRolesFromRole` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
2124
.. code-block:: javascript
2225

2326
{ revokeRolesFromRole: "<role>",

source/reference/command/updateRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Updates a :ref:`user-defined role <user-defined-roles>`. The
1919
:dbcommand:`updateRole` command must run on the role's database.
2020

21+
.. |method| replace:: :method:`db.updateRole` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
2124
An update to a field **completely replaces** the previous field's values.
2225
To grant or remove roles or :ref:`privileges <privileges>` without
2326
replacing all values, use one or more of the following commands:

source/reference/method/db.createRole.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Definition
2020
inherit privileges from other roles or both. The role applies to
2121
the database on which you run the method.
2222

23+
.. |dbcommand| replace:: :dbcommand:`createRole` command
24+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
25+
2326
The :method:`db.createRole()` method accepts the following arguments:
2427

2528

@@ -129,12 +132,6 @@ Definition
129132

130133
.. include:: /includes/fact-auth-restrictions-role-desc.rst
131134

132-
133-
134-
135-
136-
The :method:`db.createRole()` method wraps the :dbcommand:`createRole`
137-
command.
138135

139136
Roles
140137
~~~~~

source/reference/method/db.dropAllRoles.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Definition
2323
The :method:`db.dropAllRoles()` method removes *all*
2424
:ref:`user-defined <user-defined-roles>` roles from the database.
2525

26+
.. |dbcommand| replace:: :dbcommand:`dropAllRolesFromDatabase` command
27+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
28+
2629
The :method:`db.dropAllRoles()` method takes the following argument:
2730

2831

@@ -55,9 +58,6 @@ Definition
5558
:returns:
5659
The number of :ref:`user-defined <user-defined-roles>` roles dropped.
5760

58-
The :method:`db.dropAllRoles()` method wraps the
59-
:dbcommand:`dropAllRolesFromDatabase` command.
60-
6161
.. |local-cmd-name| replace:: :method:`db.dropAllRoles()`
6262

6363
Behavior

source/reference/method/db.dropRole.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Deletes a :ref:`user-defined <user-defined-roles>` role from the
1919
database on which you run the method.
2020

21+
.. |dbcommand| replace:: :dbcommand:`dropRole` command
22+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
23+
2124
The :method:`db.dropRole()` method takes the following arguments:
2225

2326

@@ -52,9 +55,6 @@ Definition
5255

5356

5457

55-
The :method:`db.dropRole()` method wraps the :dbcommand:`dropRole`
56-
command.
57-
5858
.. |local-cmd-name| replace:: :method:`db.dropRole()`
5959

6060
Behavior

source/reference/method/db.grantPrivilegesToRole.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Grants additional :ref:`privileges <privileges>` to a :ref:`user-defined
1919
<user-defined-roles>` role.
2020

21+
.. |dbcommand| replace:: :dbcommand:`grantPrivilegesToRole` command
22+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
23+
2124
The :method:`db.grantPrivilegesToRole()` method uses the following syntax:
2225

2326
.. code-block:: javascript
@@ -82,9 +85,6 @@ Definition
8285

8386
.. |local-cmd-name| replace:: :method:`db.grantPrivilegesToRole()`
8487

85-
The :method:`db.grantPrivilegesToRole()` method wraps the
86-
:dbcommand:`grantPrivilegesToRole` command.
87-
8888
Behavior
8989
--------
9090

source/reference/method/db.grantRolesToRole.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Grants roles to a :ref:`user-defined role <user-defined-roles>`.
1919

20+
.. |dbcommand| replace:: :dbcommand:`grantRolesToRole` command
21+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
22+
2023
The :method:`db.grantRolesToRole()` method uses the following syntax:
2124

2225
.. code-block:: javascript
@@ -68,9 +71,6 @@ Definition
6871
.. |local-cmd-name| replace:: :method:`db.grantRolesToRole()`
6972
.. include:: /includes/fact-roles-array-contents.rst
7073

71-
The :method:`db.grantRolesToRole()` method wraps the
72-
:dbcommand:`grantRolesToRole` command.
73-
7474
Behavior
7575
--------
7676

source/reference/method/db.revokePrivilegesFromRole.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ Definition
1616
.. method:: db.revokePrivilegesFromRole(rolename, privileges, writeConcern)
1717

1818
Removes the specified privileges from the :ref:`user-defined
19-
<user-defined-roles>` role on the database where the method runs. The
20-
:method:`db.revokePrivilegesFromRole` method has the following syntax:
19+
<user-defined-roles>` role on the database where the method runs.
20+
21+
.. |dbcommand| replace:: :dbcommand:`revokePrivilegesFromRole` command
22+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
23+
24+
The :method:`db.revokePrivilegesFromRole` method has the following syntax:
2125

2226
.. code-block:: javascript
2327

@@ -74,8 +78,6 @@ Definition
7478

7579

7680

77-
The :method:`db.revokePrivilegesFromRole()` method wraps the
78-
:dbcommand:`revokePrivilegesFromRole` command.
7981

8082
Behavior
8183
--------

source/reference/method/db.revokeRolesFromRole.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Removes the specified inherited roles from a role.
1919

20+
.. |dbcommand| replace:: :dbcommand:`revokeRolesFromRole` command
21+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
22+
2023
The :method:`db.revokeRolesFromRole()` method uses the following syntax:
2124

2225
.. code-block:: javascript
@@ -67,9 +70,6 @@ Definition
6770
.. |local-cmd-name| replace:: :method:`db.revokeRolesFromRole()`
6871
.. include:: /includes/fact-roles-array-contents.rst
6972

70-
The :method:`db.revokeRolesFromRole()` method wraps the
71-
:dbcommand:`revokeRolesFromRole` command.
72-
7373
Behavior
7474
--------
7575

source/reference/method/db.updateRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Updates a :ref:`user-defined role <user-defined-roles>`. The
1919
:method:`db.updateRole()` method must run on the role's database.
2020

21+
.. |dbcommand| replace:: :dbcommand:`updateRole` command
22+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
23+
2124
An update to a field **completely replaces** the previous field's values.
2225
To grant or remove roles or :ref:`privileges <privileges>` without
2326
replacing all values, use one or more of the following methods:

0 commit comments

Comments
 (0)