MongoDB Documentation, Release 3.0.4 For an overview of roles and privileges, see Authorization (page 324). To view a role’s information, you must be explicitly granted the role or must have the viewRole (page 420) action (page 419) on the role’s database. Step 1: Connect to MongoDB with the appropriate privileges. Connect to mongod or mongos as a user with the privileges specified in the prerequisite section. The following procedure uses the siteUserAdmin created in Create a User Administrator (page 384). mongo --port 27017 -u siteUserAdmin -p password --authenticationDatabase admin Step 2: Identify the user’s roles. Use the usersInfo command or db.getUser() method to display user information. For example, to view roles for reportsUser created in Add a User to a Database (page 386), issue: use reporting db.getUser("reportsUser") In the returned document, the roles (page 416) field displays all roles for reportsUser : ... "roles" : [ { "role" : "readWrite", "db" : "accounts" }, { "role" : "read", "db" : "reporting" }, { "role" : "read", "db" : "products" }, { "role" : "read", "db" : "sales" } ] Step 3: Identify the privileges granted by the roles. For a given role, use the db.getRole() method, or the rolesInfo command, with the showPrivileges option: For example, to view the privileges granted by read role on the products database, use the following operation, issue: use products db.getRole( "read", { showPrivileges: true } ) In the returned document, the privileges and inheritedPrivileges arrays. The privileges lists the privileges directly specified by the role and excludes those privileges inherited from other roles. The inheritedPrivileges lists all privileges granted by this role, both directly specified and inherited. If the role does not inherit from other roles, the two fields are the same. Chapter 6. Security 392 ... "privileges" : [ { "resource": { "db" : "products", "collection" : "" }, "actions": [ "collStats","dbHash","dbStats","find","killCursors","planCacheRead" ] }, { "resource" : { "db" : "products", "collection" : "system.js" }, Prerequisites Procedure