[DOCS-1693] db.addUser() docs are unclear about "roles" Created: 09/Jul/13  Updated: 09/Jul/13  Resolved: 09/Jul/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Derick Rethans Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 32 weeks, 1 day ago

 Description   

At http://docs.mongodb.org/manual/reference/method/db.addUser/#db.addUser it says about roles in the table:

roles array Optional. An array of user roles.

But there is no statement about what happens if no roles are passed, or this field isn't present. I presume that means that it uses legacy auth?



 Comments   
Comment by auto [ 09/Jul/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1693: roles is not optional in new-style auth documents.
Branch: master
https://github.com/mongodb/docs/commit/ee3f5fe9a5d101260041b32ae1c7c402a891cc62

Comment by Sam Kleinman (Inactive) [ 09/Jul/13 ]

The statement that the roles field is optional is in error. If you pass a document to db.addUser without a roles field, it errors.

If you pass a document to db.addUser() you get new-style access control documents, if you give db.addUser arguments, you get a legacy auth document.

You can use new-style access control documents with legacy auth.

Removing optional tag for this field.

Generated at Thu Feb 08 07:41:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.