@@ -29,9 +29,14 @@ title: Create the user administrator.
29
29
level : 4
30
30
ref : create-user-admin
31
31
pre : |
32
+
32
33
In the ``admin`` database, add a user with the
33
- :authrole:`userAdminAnyDatabase` role. For example, the following
34
- creates the user ``myUserAdmin`` in the ``admin`` database:
34
+ :authrole:`userAdminAnyDatabase` role. Include additional roles as
35
+ needed for this user. For example, the following
36
+ creates the user ``myUserAdmin`` in the ``admin`` database with the
37
+ :authrole:`userAdminAnyDatabase` role and the
38
+ :authrole:`readWriteAnyDatabase` role.
39
+
35
40
action :
36
41
pre : |
37
42
.. note::
@@ -48,7 +53,7 @@ action:
48
53
{
49
54
user: "myUserAdmin",
50
55
pwd: "abc123",
51
- roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
56
+ roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ]
52
57
}
53
58
)
54
59
post : |
@@ -121,11 +126,6 @@ pre: |
121
126
:doc:`user-defined roles </core/security-user-defined-roles>` to the
122
127
users.
123
128
124
- The ``myUserAdmin`` user only has privileges to :doc:`manage users
125
- and roles </tutorial/manage-users-and-roles>`. As ``myUserAdmin``, if
126
- you attempt to perform any other operations, such as read from a
127
- ``foo`` collection in the ``test`` database, MongoDB returns an error.
128
-
129
129
action :
130
130
pre : |
131
131
The following operation adds a user ``myTester`` to the ``test``
0 commit comments