title: How to create a database admin that will manage its database users
body: <p>I'm using MongoDB ver2.6.2 and want to create a database admin that will able to manage its users (add and remove them). I have two databases - admin and books. The user admin_books is supposed to be a dbOwner and be able to create and remove users from books database:</p>
  
  <pre><code>/* creating admin db */
  &gt; use admin;
  switched to db admin
  &gt; db.createUser( { "user" : "admin_root", "pwd": "pass", "roles" : ["root"] } )
  Successfully added user: { "user" : "admin_root", "roles" : [ "root" ] }
  
  /* creating books db */
  &gt; use books;
  switched to db books
  &gt; db.createUser( { "user" : "admin_books", "pwd": "pass", "roles" : ["dbOwner"] } )
  Successfully added user: { "user" : "admin_books", "roles" : [ "dbOwner" ] }
  &gt; db.createUser( { "user" : "logger", "pwd": "pass", "roles" : ["readWrite"] } )
  Successfully added user: { "user" : "logger", "roles" : [ "readWrite" ] }
  </code></pre>
  
  <p>I found that all users are actually stored in admin db starting from version 2.6.
  When I try to query db users when logging in to books db as admin_books I'm getting the following error:</p>
  
  <pre><code>&gt; use books
  switched to db books
  &gt; db.auth("admin_books", "pass")
  1
  &gt; db.system.users.find()
  error: { "$err" : "not authorized for query on books.system.users", "code" : 13 }
  </code></pre>
  
  <p>Is there any roles and privileges I need to add to admin_books to allow him to manage users?
  Or what would be the correct way of doing this?</p>
  
  <p>I know there was a similar <a href="https://stackoverflow.com/questions/20525103/what-mongodb-user-privileges-do-i-need-to-add-a-user-to-a-new-another-mongo-data?rq=1">question</a>, but the answer suggests to add a 'userAdminAnyDatabase' privilege to user even though the admin has to manage only single db.</p>