Manage Users and Roles
On this page
Overview
This tutorial provides examples for user and role management under the MongoDB's authorization model. Add Users describes how to add a new user to MongoDB.
Prerequisites
Create a User-Defined Role
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.
Modify Access for an Existing User
Prerequisites
Procedure
Modify the Password for an Existing User
Prerequisites
To modify the password of another user on a database, you must have the
changePassword
action
on that database.
Procedure
Tip
See also:
View a User's Roles
Prerequisites
To view another user's information, you must have the
viewUser
action on the
other user's database.
Users can view their own information.
Procedure
View a Role's Privileges
Prerequisites
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.