[DOCS-3987] Comment on: "manual/tutorial/add-user-to-database.txt" Created: 03/Sep/14  Updated: 16/Mar/15  Resolved: 17/Oct/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.12

Type: Improvement Priority: Blocker - P1
Reporter: Kay Agahd Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/manual/tutorial/add-user-to-database/
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 IKDhPmJcdw
Referrer: http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CEYQFjAB&url=http%3A%2F%2Fdocs.mongodb.org%2Fmanual%2Ftutorial%2Fadd-user-to-database&ei=CR4HVPysH-HJ0QX8t4GoDg&usg=AFQjCNFddqbbnggCky_ZTVNh4nB4Y9XTxA&sig2=aG1parIbWjD53MGtFGpsFA&bvm=bv.74115972,d.bGQ&cad=rja
Screen Resolution: 1680 x 1050
repo: docs
source: tutorial/add-user-to-database


Participants:
Days since reply: 9 years, 17 weeks, 5 days ago

 Description   

When adding a user to multiple databases, use unique username-and-password combinations for each database

While this sentence is true for itself, it may lead to the conclusion that a user who needs to access different databases has to be added to each database individually.
However, it's recommended to add such an user only once by giving him/her multiple roles for all the databases he/she needs to access.
For example:

{
  _id: "home.Kari",
  user: "Kari",
  db: "home",
  credentials: { "MONGODB-CR" :"<hashed password>" },
  roles : [
            { role: "read", db: "home" },
            { role: "readWrite", db: "test" },
            { role: "appUser", db: "myApp" }
          ],
  customData: { zipCode: "64157" }
}


This user has been added only once to the home database having access to the three databases home, test and myApp.
See: http://docs.mongodb.org/manual/reference/system-users-collection/



 Comments   
Comment by Githook User [ 17/Oct/14 ]

Author:

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

Message: DOCS-3987: remove antiquated fact
Branch: master
https://github.com/mongodb/docs/commit/cf32b1ce570a74a3a97a22a6a8423af4571679cf

Comment by Sam Kleinman (Inactive) [ 17/Oct/14 ]

removing this line. refers to 2.2-era user data model fact.

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