- Security >
- Security Reference >
- Privilege Actions
Privilege Actions¶
New in version 2.6.
On this page
Privilege actions define the operations a user can perform on a resource. A MongoDB privilege comprises a resource and the permitted actions. This page lists available actions grouped by common purpose.
MongoDB provides built-in roles with pre-defined pairings of resources and permitted actions. For lists of the actions granted, see Built-In Roles. To define custom roles, see Create a User-Defined Role.
Query and Write Actions¶
-
find¶ User can perform the
db.collection.find()method. Apply this action to database or collection resources.
-
remove¶ User can perform the
db.collection.remove()method. Apply this action to database or collection resources.
Database Management Actions¶
-
changeCustomData¶ User can change the custom information of any user in the given database. Apply this action to database resources.
-
changeOwnCustomData¶ Users can change their own custom information. Apply this action to database resources. See also Change Your Password and Custom Data.
-
changeOwnPassword¶ Users can change their own passwords. Apply this action to database resources. See also Change Your Password and Custom Data.
-
changePassword¶ User can change the password of any user in the given database. Apply this action to database resources.
-
createCollection¶ User can perform the
db.createCollection()method. Apply this action to database or collection resources.
-
createIndex¶ Provides access to the
db.collection.createIndex()method and thecreateIndexescommand. Apply this action to database or collection resources.
-
createRole¶ User can create new roles in the given database. Apply this action to database resources.
-
createUser¶ User can create new users in the given database. Apply this action to database resources.
-
dropCollection¶ User can perform the
db.collection.drop()method. Apply this action to database or collection resources.
-
dropRole¶ User can delete any role from the given database. Apply this action to database resources.
-
dropUser¶ User can remove any user from the given database. Apply this action to database resources.
-
emptycapped¶ User can perform the
emptycappedcommand. Apply this action to database or collection resources.
-
enableProfiler¶ User can perform the
db.setProfilingLevel()method. Apply this action to database resources.
-
grantRole¶ User can grant any role in the database to any user from any database in the system. Apply this action to database resources.
-
killCursors¶ User can kill cursors on the target collection.
-
revokeRole¶ User can remove any role from any user from any database in the system. Apply this action to database resources.
-
unlock¶ User can perform the
db.fsyncUnlock()method. Apply this action to theclusterresource.
-
viewRole¶ User can view information about any role in the given database. Apply this action to database resources.
-
viewUser¶ User can view the information of any user in the given database. Apply this action to database resources.
Deployment Management Actions¶
-
authSchemaUpgrade¶ User can perform the
authSchemaUpgradecommand. Apply this action to theclusterresource.
-
cleanupOrphaned¶ User can perform the
cleanupOrphanedcommand. Apply this action to theclusterresource.
-
cpuProfiler¶ User can enable and use the CPU profiler. Apply this action to the
clusterresource.
-
inprog¶ User can use the
db.currentOp()method to return pending and active operations. Apply this action to theclusterresource.
-
invalidateUserCache¶ Provides access to the
invalidateUserCachecommand. Apply this action to theclusterresource.
-
killop¶ User can perform the
db.killOp()method. Apply this action to theclusterresource.
-
planCacheRead¶ User can perform the
planCacheListPlansandplanCacheListQueryShapescommands and thePlanCache.getPlansByQuery()andPlanCache.listQueryShapes()methods. Apply this action to database or collection resources.
-
planCacheWrite¶ User can perform the
planCacheClearcommand and thePlanCache.clear()andPlanCache.clearPlansByQuery()methods. Apply this action to database or collection resources.
-
storageDetails¶ User can perform the
storageDetailscommand. Apply this action to database or collection resources.
Replication Actions¶
-
appendOplogNote¶ User can append notes to the oplog. Apply this action to the
clusterresource.
-
replSetConfigure¶ User can configure a replica set. Apply this action to the
clusterresource.
-
replSetGetStatus¶ User can perform the
replSetGetStatuscommand. Apply this action to theclusterresource.
-
replSetHeartbeat¶ User can perform the
replSetHeartbeatcommand. Apply this action to theclusterresource.
-
replSetStateChange¶ User can change the state of a replica set through the
replSetFreeze,replSetMaintenance,replSetStepDown, andreplSetSyncFromcommands. Apply this action to theclusterresource.
Sharding Actions¶
-
enableSharding¶ User can enable sharding on a database using the
enableShardingcommand and can shard a collection using theshardCollectioncommand. Apply this action to database or collection resources.
-
flushRouterConfig¶ User can perform the
flushRouterConfigcommand. Apply this action to theclusterresource.
-
getShardMap¶ User can perform the
getShardMapcommand. Apply this action to theclusterresource.
-
getShardVersion¶ User can perform the
getShardVersioncommand. Apply this action to database resources.
-
listShards¶ User can perform the
listShardscommand. Apply this action to theclusterresource.
-
moveChunk¶ User can perform the
moveChunkcommand. In addition, user can perform themovePrimarycommand provided that the privilege is applied to an appropriate database resource. Apply this action to database or collection resources.
-
removeShard¶ User can perform the
removeShardcommand. Apply this action to theclusterresource.
User can perform the
shardingStatecommand. Apply this action to theclusterresource.
-
splitChunk¶ User can perform the
splitChunkcommand. Apply this action to database or collection resources.
-
splitVector¶ User can perform the
splitVectorcommand. Apply this action to database or collection resources.
Server Administration Actions¶
-
applicationMessage¶ User can perform the
logApplicationMessagecommand. Apply this action to theclusterresource.
-
closeAllDatabases¶ User can perform the
closeAllDatabasescommand. Apply this action to theclusterresource.
-
collMod¶ User can perform the
collModcommand. Apply this action to database or collection resources.
-
compact¶ User can perform the
compactcommand. Apply this action to database or collection resources.
-
connPoolSync¶ User can perform the
connPoolSynccommand. Apply this action to theclusterresource.
-
convertToCapped¶ User can perform the
convertToCappedcommand. Apply this action to database or collection resources.
-
dropDatabase¶ User can perform the
dropDatabasecommand. Apply this action to database resources.
-
dropIndex¶ User can perform the
dropIndexescommand. Apply this action to database or collection resources.
-
getParameter¶ User can perform the
getParametercommand. Apply this action to theclusterresource.
-
hostInfo¶ Provides information about the server the MongoDB instance runs on. Apply this action to the
clusterresource.
-
reIndex¶ User can perform the
reIndexcommand. Apply this action to database or collection resources.
-
renameCollectionSameDB¶ Allows the user to rename collections on the current database using the
renameCollectioncommand. Apply this action to database resources.Additionally, the user must either have
findon the source collection or not havefindon the destination collection.If a collection with the new name already exists, the user must also have the
dropCollectionaction on the destination collection.
-
repairDatabase¶ User can perform the
repairDatabasecommand. Apply this action to database resources.
-
setParameter¶ User can perform the
setParametercommand. Apply this action to theclusterresource.
Diagnostic Actions¶
-
collStats¶ User can perform the
collStatscommand. Apply this action to database or collection resources.
-
connPoolStats¶ User can perform the
connPoolStatsandshardConnPoolStatscommands. Apply this action to theclusterresource.
-
cursorInfo¶ User can perform the
cursorInfocommand. Apply this action to theclusterresource.
-
diagLogging¶ User can perform the
diagLoggingcommand. Apply this action to theclusterresource.
-
getCmdLineOpts¶ User can perform the
getCmdLineOptscommand. Apply this action to theclusterresource.
-
indexStats¶ User can perform the
indexStatscommand. Apply this action to database or collection resources.Changed in version 3.0: MongoDB 3.0 removes the
indexStatscommand.
-
listDatabases¶ User can perform the
listDatabasescommand. Apply this action to theclusterresource.
-
listCollections¶ User can perform the
listCollectionscommand. Apply this action to database resources.
-
listIndexes¶ User can perform the
ListIndexescommand. Apply this action to database or collection resources.
-
serverStatus¶ User can perform the
serverStatuscommand. Apply this action to theclusterresource.