From 368ab7877f0f63ad59f653940952ad03877b25f4 Mon Sep 17 00:00:00 2001 From: Michael Paik Date: Thu, 21 Aug 2014 19:20:27 -0400 Subject: [PATCH 1/4] DOCS-3711: clarify different procedure for adding first user admin or root user --- source/includes/access-create-user.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/includes/access-create-user.rst b/source/includes/access-create-user.rst index 9fe265edf68..62275d4aec6 100644 --- a/source/includes/access-create-user.rst +++ b/source/includes/access-create-user.rst @@ -7,5 +7,15 @@ You must have the :authaction:`grantRole` :ref:`action user. If you have the :authrole:`userAdmin` or :authrole:`userAdminAnyDatabase` -role, or if you are authenticated using the :ref:`localhost exception -`, you have those actions. +role you have those actions. + +.. note:: + + If your database has no users, you *must* connect to :program:`mongod` + using the :ref:`localhost exception ` + or use the :option:`--noauth ` option when starting + :program:`mongod`. In such a case, skip to Step 3 of the procedure. + + Note that if users exist in the MongoDB database, but none of them have the + appropriate prerequisites or you do not have access to them, only the + :option:`--noauth ` method is available. From 69de60479e4b172e57f096735076cfb6bbf8566c Mon Sep 17 00:00:00 2001 From: Michael Paik Date: Thu, 21 Aug 2014 19:23:23 -0400 Subject: [PATCH 2/4] DOCS-3711: minor diction fix --- source/includes/access-create-user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/access-create-user.rst b/source/includes/access-create-user.rst index 62275d4aec6..d86b3fbadbb 100644 --- a/source/includes/access-create-user.rst +++ b/source/includes/access-create-user.rst @@ -14,7 +14,7 @@ role you have those actions. If your database has no users, you *must* connect to :program:`mongod` using the :ref:`localhost exception ` or use the :option:`--noauth ` option when starting - :program:`mongod`. In such a case, skip to Step 3 of the procedure. + :program:`mongod`. In such cases, skip to Step 3 of the procedure. Note that if users exist in the MongoDB database, but none of them have the appropriate prerequisites or you do not have access to them, only the From 59112d97100623f3ca46092ba711d324f3cd7bb9 Mon Sep 17 00:00:00 2001 From: Michael Paik Date: Thu, 21 Aug 2014 19:25:08 -0400 Subject: [PATCH 3/4] DOCS-3711: small diction fix --- source/includes/access-create-user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/access-create-user.rst b/source/includes/access-create-user.rst index d86b3fbadbb..82cfc78c0c8 100644 --- a/source/includes/access-create-user.rst +++ b/source/includes/access-create-user.rst @@ -7,7 +7,7 @@ You must have the :authaction:`grantRole` :ref:`action user. If you have the :authrole:`userAdmin` or :authrole:`userAdminAnyDatabase` -role you have those actions. +role, you have those actions. .. note:: From 20c8a4d02838a516e89fa2b79bf97d53404ff5b5 Mon Sep 17 00:00:00 2001 From: Michael Paik Date: Thu, 21 Aug 2014 22:11:51 -0400 Subject: [PATCH 4/4] DOCS-3711 - reworked --- source/includes/access-create-first-user-proc.rst | 9 +++++++++ source/includes/access-create-user.rst | 11 ----------- source/tutorial/add-admin-user.txt | 5 +++++ source/tutorial/add-user-administrator.txt | 5 +++++ source/tutorial/add-user-to-database.txt | 5 +++++ 5 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 source/includes/access-create-first-user-proc.rst diff --git a/source/includes/access-create-first-user-proc.rst b/source/includes/access-create-first-user-proc.rst new file mode 100644 index 00000000000..eb08ed5e829 --- /dev/null +++ b/source/includes/access-create-first-user-proc.rst @@ -0,0 +1,9 @@ +If your MongoDB database has no users, you *must* connect to :program:`mongod` +using the :ref:`localhost exception ` +or use the :option:`--noauth ` option when starting +:program:`mongod`. In such cases, skip to Step 3 of the procedure. + +If users exist in the MongoDB database, but none of them has the +appropriate prerequisites to create a new user or you do not have access +to them, you *must* restart :program:`mongod` with the :option:`--noauth +` option. diff --git a/source/includes/access-create-user.rst b/source/includes/access-create-user.rst index 82cfc78c0c8..5dbefbfe87f 100644 --- a/source/includes/access-create-user.rst +++ b/source/includes/access-create-user.rst @@ -8,14 +8,3 @@ user. If you have the :authrole:`userAdmin` or :authrole:`userAdminAnyDatabase` role, you have those actions. - -.. note:: - - If your database has no users, you *must* connect to :program:`mongod` - using the :ref:`localhost exception ` - or use the :option:`--noauth ` option when starting - :program:`mongod`. In such cases, skip to Step 3 of the procedure. - - Note that if users exist in the MongoDB database, but none of them have the - appropriate prerequisites or you do not have access to them, only the - :option:`--noauth ` method is available. diff --git a/source/tutorial/add-admin-user.txt b/source/tutorial/add-admin-user.txt index 25db5d02520..66eb35779e8 100644 --- a/source/tutorial/add-admin-user.txt +++ b/source/tutorial/add-admin-user.txt @@ -38,6 +38,11 @@ Prerequisites .. include:: /includes/access-create-user.rst +Creating the First User or First User With Appropriate Privileges +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/access-create-first-user-proc.rst + Procedure --------- diff --git a/source/tutorial/add-user-administrator.txt b/source/tutorial/add-user-administrator.txt index 0b656d0bb38..bace6ff0978 100644 --- a/source/tutorial/add-user-administrator.txt +++ b/source/tutorial/add-user-administrator.txt @@ -33,6 +33,11 @@ Prerequisites .. include:: /includes/access-create-user.rst +Creating the First User or First User With Appropriate Privileges +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/access-create-first-user-proc.rst + Procedure --------- diff --git a/source/tutorial/add-user-to-database.txt b/source/tutorial/add-user-to-database.txt index 419eecfbc6c..46c7be23308 100644 --- a/source/tutorial/add-user-to-database.txt +++ b/source/tutorial/add-user-to-database.txt @@ -59,6 +59,11 @@ user administrator, do so as described in .. include:: /includes/access-create-user.rst +Creating the First User or First User With Appropriate Privileges +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/access-create-first-user-proc.rst + Procedures ----------