Skip to content

Commit c771b45

Browse files
authored
DOCSP-27062 Adds Interlinks for mongosh Role Methods (#2275) (#2318)
* DOCSP-27062 Adds interlinks for db.% mongosh methods managing roles * Adds interlinks * Adds interlinks * Build * Build * Removes old wrapper comment
1 parent 4d757b7 commit c771b45

16 files changed

+56
-27
lines changed

source/reference/command/createRole.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ 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+
27+
2428
Syntax
2529
------
2630

source/reference/command/dropAllRolesFromDatabase.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ 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+
29+
2630
Syntax
2731
------
2832

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
Syntax
2225
------
2326

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

source/reference/command/revokePrivilegesFromRole.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Definition
1919
<user-defined-roles>` role on the database where the
2020
command is run.
2121

22+
.. |method| replace:: :method:`db.revokePrivilegesFromRole` helper method
23+
.. include:: /includes/fact-dbcommand-tip
24+
2225
Syntax
2326
------
2427

source/reference/command/revokeRolesFromRole.txt

Lines changed: 3 additions & 0 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+
.. |method| replace:: :method:`db.revokeRolesFromRole` helper method
21+
.. include:: /includes/fact-dbcommand-tip
22+
2023
Syntax
2124
------
2225

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

@@ -113,12 +116,6 @@ Definition
113116

114117
.. include:: /includes/fact-auth-restrictions-role-desc.rst
115118

116-
117-
118-
119-
120-
The :method:`db.createRole()` method wraps the :dbcommand:`createRole`
121-
command.
122119

123120
Roles
124121
~~~~~

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

@@ -44,9 +47,6 @@ Definition
4447
:returns:
4548
The number of :ref:`user-defined <user-defined-roles>` roles dropped.
4649

47-
The :method:`db.dropAllRoles()` method wraps the
48-
:dbcommand:`dropAllRolesFromDatabase` command.
49-
5050
.. |local-cmd-name| replace:: :method:`db.dropAllRoles()`
5151

5252
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

@@ -36,9 +39,6 @@ Definition
3639
- document
3740
- .. include:: /includes/fact-write-concern-spec-link.rst
3841

39-
The :method:`db.dropRole()` method wraps the :dbcommand:`dropRole`
40-
command.
41-
4242
.. |local-cmd-name| replace:: :method:`db.dropRole()`
4343

4444
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
@@ -61,9 +64,6 @@ Definition
6164

6265
.. |local-cmd-name| replace:: :method:`db.grantPrivilegesToRole()`
6366

64-
The :method:`db.grantPrivilegesToRole()` method wraps the
65-
:dbcommand:`grantPrivilegesToRole` command.
66-
6767
Behavior
6868
--------
6969

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
@@ -47,9 +50,6 @@ Definition
4750
.. |local-cmd-name| replace:: :method:`db.grantRolesToRole()`
4851
.. include:: /includes/fact-roles-array-contents.rst
4952

50-
The :method:`db.grantRolesToRole()` method wraps the
51-
:dbcommand:`grantRolesToRole` command.
52-
5353
Behavior
5454
--------
5555

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

@@ -53,8 +57,6 @@ Definition
5357
- document
5458
- .. include:: /includes/fact-write-concern-spec-link.rst
5559

56-
The :method:`db.revokePrivilegesFromRole()` method wraps the
57-
:dbcommand:`revokePrivilegesFromRole` command.
5860

5961
Behavior
6062
--------

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
@@ -46,9 +49,6 @@ Definition
4649
.. |local-cmd-name| replace:: :method:`db.revokeRolesFromRole()`
4750
.. include:: /includes/fact-roles-array-contents.rst
4851

49-
The :method:`db.revokeRolesFromRole()` method wraps the
50-
:dbcommand:`revokeRolesFromRole` command.
51-
5252
Behavior
5353
--------
5454

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)