Skip to content

DOCS-3711 #1938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions source/includes/access-create-user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
<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 <localhost-exception>`
or use the :option:`--noauth <mongod --noauth>` option when starting
:program:`mongod`. In such cases, skip to Step 3 of the procedure.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary of relative references (e.g. step 3) to other parts of content, particularly in includes files. This file is used six different files.

Also I'm not sure that this needs to be inside of a note block. It's not more special than the other items discussed in the file.

You can check for include-file use with the following operation:

$ giza includes graph -f /includes/access-create-user.rst 
{
    "/includes/access-create-user.rst": [
       "/reference/command/createUser.txt", 
       "/reference/method/db.createUser.txt", 
       "/tutorial/add-admin-user.txt", 
       "/tutorial/add-user-administrator.txt", 
       "/tutorial/add-user-to-database.txt"
     ]
 }


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 <mongod --noauth>` method is available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary of beginning sentences with "note." Seems unnecessary, and doesn't actually make things easier. Our general rule is, if it's a note, use a note box, and if it's in a note box, make sure that it is truly exceptional (in most cases its not, and we should probably use page structure to more clearly draw attention to points like this.)

I'm also worried about the generic and somewhat ambiguous use of the term database here.

I'd probably rewrite this as:

If you have defined any users for the mongod instance, but no user has the permission to create a user, you must restart the mongod instance with the --noauth option to create new users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mongod instance != database - it depends on dbpath so in this case database is correct. Will merge some of the stylistic suggestions though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've never used the term database to refer to the contents of dbpath.

also, it would be bad to say "in any database" because credentials are only in the admin database in 2.6 (which is what this refers to) so you should say in the mongod's instnace dbpath or similar.