Skip to content

Users and roles

  • MongoDB

The users and roles editor shows a database’s users and custom roles. For the selected user you see its roles and the privileges they give; for a role, the roles it inherits and its privileges. Forms create and edit users and roles and show the commands they run as you fill them in. Passwords never appear in those commands.

  • Choose Users and roles from a database’s menu in the explorer.
  • Choose Manage users or Manage roles on the Users or Roles folder.
  • Double-click a user or a role.

Switch between the lists with Users and Roles. Show built-in roles adds the built-in roles to the Roles list.

List Columns Details of the selected entry
Users User, Roles, Mechanisms Roles, Privileges (from its roles) and Custom data
Roles Role, Inherits, Privileges Inherits and Privileges; inherited entries are marked
  1. On the Users list, choose Create user….
  2. Enter the User name and Password.
  3. Tick the Mechanisms the user can sign in with (SCRAM-SHA-256 is ticked to start with).
  4. Under Roles, enter a role and its database for each role; Add role adds a row.
  5. Optionally add Custom data (optional) as a document.
  6. Check the command, which shows passwordPrompt() in place of the password, choose Create…, then Run in the confirmation.
db.getSiblingDB('catalog').createUser({ user: 'reporting', pwd: passwordPrompt(), roles: [ { role: 'read', db: 'catalog' } ], mechanisms: [ 'SCRAM-SHA-256' ] })

To change a user, select it and choose Edit…. New password (empty keeps it) leaves the password as it is when empty.

  1. On the Roles list, choose Create role….
  2. Enter the Role name.
  3. Under Privileges, pick a resource for each privilege (Database, Collection, Cluster or Any resource) and its actions, such as find, collStats. Add privilege adds a row.
  4. Under Inherited roles, add the roles this one includes.
  5. Check the createRole command, choose Create…, then Run.

Built-in roles cannot be edited or dropped.

Select it and choose Drop…. The confirmation shows the dropUser or dropRole command; choose Drop to run it.

Documents Querybara 0.1.1 · built frombc9f5aa