Docs Menu

Docs HomeMongoDB Manual

Manage Users and Roles

On this page

  • Overview
  • Prerequisites
  • Create a User-Defined Role
  • Modify Access for an Existing User
  • Modify the Password for an Existing User
  • View a User's Roles
  • View a Role's Privileges

This tutorial provides examples for user and role management under the MongoDB's authorization model. Create a User describes how to add a new user to MongoDB.

Roles grant users access to MongoDB resources. MongoDB provides a number of built-in roles that administrators can use to control access to a MongoDB system. However, if these roles cannot describe the desired set of privileges, you can create new roles in a particular database.

To modify the password of another user on a database, you must have the changePassword action on that database.

Tip

See also:

To view another user's information, you must have the viewUser action on the other user's database.

Users can view their own information.

To view a role's information, you must be either explicitly granted the role or must have the viewRole action on the role's database.

←  User-Defined RolesChange Your Password and Custom Data →
Share Feedback