@@ -9,7 +9,7 @@ Built-In Roles
99.. contents:: On this page
1010 :local:
1111 :backlinks: none
12- :depth: 1
12+ :depth: 2
1313 :class: singlecol
1414
1515MongoDB grants access to data and commands through :ref:`role-based
@@ -26,20 +26,82 @@ Each of MongoDB's built-in roles defines access at the database level for all
2626*non*-system collections in the role's database and at the collection level
2727for all :doc:`system collections </reference/system-collections>`.
2828
29- MongoDB provides the built-in :ref:`database user <database-user-roles>` and
30- :ref:`database administration <database-administration-roles>` roles on
31- *every* database. MongoDB provides all other built-in roles only on the
32- ``admin`` database.
33-
3429This section describes the privileges for each built-in role. You can also
3530view the privileges for a built-in role at any time by issuing the
3631:dbcommand:`rolesInfo` command with the ``showPrivileges`` and
3732``showBuiltinRoles`` fields both set to ``true``.
3833
34+ Compatibility
35+ -------------
36+
37+ .. |page-topic| replace:: use built-in roles
38+
39+ .. include:: /includes/fact-atlas-compatible.rst
40+
41+ {+atlas+} deployments have different built-in roles than self-hosted
42+ deployments. See the following resources to learn more:
43+
44+ - :ref:`atlas-built-in-roles`
45+ - :ref:`self-hosted-built-in-roles`
46+
47+ .. _atlas-built-in-roles:
48+
49+ {+atlas+} Built-In Roles
50+ -----------------------------
51+
52+ You can assign the following built-in database user roles for
53+ deployments hosted in {+atlas+}:
54+
55+ .. list-table::
56+ :header-rows: 1
57+
58+ * - MongoDB Role
59+ - Role Name in the {+atlas+} UI
60+ - Inherited Roles or Privilege Actions
61+
62+ * - ``atlasAdmin``
63+ - :guilabel:`Atlas admin`
64+ -
65+ - :authrole:`readWriteAnyDatabase`
66+ - :authrole:`readAnyDatabase`
67+ - :authrole:`dbAdminAnyDatabase`
68+ - :authrole:`clusterMonitor`
69+ - :authaction:`cleanupOrphaned`
70+ - :authaction:`enableSharding`
71+ - :authaction:`flushRouterConfig`
72+ - :authaction:`moveChunk`
73+ - :authaction:`viewUser`
74+
75+ * - ``readWriteAnyDatabase``
76+ - :guilabel:`Read and write to any database`
77+ -
78+ - :authrole:`readWriteAnyDatabase`
79+
80+ * - ``readAnyDatabase``
81+ - :guilabel:`Only read any database`
82+ -
83+ - :authrole:`readAnyDatabase`
84+
85+ You can create database users and assign built-in roles in the
86+ {+atlas+} UI. To learn more, see :atlas:`Add Database Users </security-add-mongodb-users/#add-database-users>`.
87+
88+ .. _self-hosted-built-in-roles:
89+
90+ Self-Hosted Deployment Built-In Roles
91+ -------------------------------------
92+
93+ MongoDB provides the following built-in roles for self-hosted
94+ deployments:
95+
96+ - :ref:`Database user <database-user-roles>` and
97+ :ref:`database administration <database-administration-roles>` roles
98+ on *every* database
99+ - All other roles only on the ``admin`` database
100+
39101.. _database-user-roles:
40102
41103Database User Roles
42- -------------------
104+ ~~~~~~~~~~~~~~~~~~~
43105
44106Every database includes the following client roles:
45107
@@ -88,7 +150,7 @@ Every database includes the following client roles:
88150.. _database-administration-roles:
89151
90152Database Administration Roles
91- -----------------------------
153+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92154
93155Every database includes the following database administration roles:
94156
@@ -210,7 +272,7 @@ Every database includes the following database administration roles:
210272.. _admin-roles:
211273
212274Cluster Administration Roles
213- ----------------------------
275+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214276
215277.. include:: /includes/extracts/built-in-roles-cluster-admin-roles.rst
216278
@@ -552,7 +614,7 @@ Cluster Administration Roles
552614.. _backup-and-restore-roles:
553615
554616Backup and Restoration Roles
555- ----------------------------
617+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
556618
557619.. include:: /includes/extracts/built-in-roles-backup-roles.rst
558620
@@ -711,7 +773,7 @@ Backup and Restoration Roles
711773.. _auth-any-database-roles:
712774
713775All-Database Roles
714- ------------------
776+ ~~~~~~~~~~~~~~~~~~
715777
716778.. include:: /includes/extracts/built-in-roles-all-database-roles.rst
717779
@@ -774,7 +836,7 @@ All-Database Roles
774836.. _superuser:
775837
776838Superuser Roles
777- ---------------
839+ ~~~~~~~~~~~~~~~
778840
779841Several roles provide either indirect or direct system-wide superuser access.
780842
@@ -801,7 +863,7 @@ The following role provides full privileges on all resources:
801863 collection in the ``config`` database.
802864
803865Internal Role
804- -------------
866+ ~~~~~~~~~~~~~
805867
806868.. authrole:: __system
807869
0 commit comments