角色分類 |
角色 |
許可權及角色 (本文大小寫可能有些變化,使用時請參考官方文檔) |
Database User Roles |
read |
CollStats,dbHash,dbStats,find,killCursors,listIndexes,listCollections |
readWrite |
CollStats,ConvertToCapped,CreateCollection,DbHash,DbStats, DropCollection,CreateIndex,DropIndex,Emptycapped,Find, Insert,KillCursors,ListIndexes,ListCollections,Remove, RenameCollectionSameDB,update |
Database Administration Roles |
dbAdmin |
collStats,dbHash,dbStats,find,killCursors,listIndexes,listCollections, dropCollection 和 createCollection 在 system.profile |
dbOwner |
角色:readWrite, dbAdmin,userAdmin |
userAdmin |
ChangeCustomData,ChangePassword,CreateRole,CreateUser, DropRole,DropUser,GrantRole,RevokeRole,ViewRole,viewUser |
Cluster Administration Roles |
clusterAdmin |
角色:clusterManager, clusterMonitor, hostManager |
clusterManager |
AddShard,ApplicationMessage,CleanupOrphaned,FlushRouterConfig, ListShards,RemoveShard,ReplSetConfigure,ReplSetGetStatus, ReplSetStateChange,Resync, EnableSharding,MoveChunk,SplitChunk,splitVector |
clusterMonitor |
connPoolStats,cursorInfo,getCmdLineOpts,getLog,getParameter, getShardMap,hostInfo,inprog,listDatabases,listShards,netstat, replSetGetStatus,serverStatus,shardingState,top collStats,dbStats,getShardVersion |
hostManager |
applicationMessage,closeAllDatabases,connPoolSync,cpuProfiler, diagLogging,flushRouterConfig,fsync,invalidateUserCache,killop, logRotate,resync,setParameter,shutdown,touch,unlock |
Backup and Restoration Roles |
backup |
提供在admin資料庫mms.backup文檔中insert,update許可權 列出所有資料庫:listDatabases 列出所有集合索引:listIndexes 對以下提供查詢操作:find *非系統集合 *系統集合:system.indexes, system.namespaces, system.js *集合:admin.system.users 和 admin.system.roles |
restore |
非系統集合、system.js,admin.system.users 和 admin.system.roles 及2.6 版本的system.users提供以下許可權: collMod,createCollection,createIndex,dropCollection,insert 列出所有資料庫:listDatabases system.users :find,remove,update |
All-Database Roles |
readAnyDatabase |
提供所有資料庫中唯讀許可權:read 列出叢集所有資料庫:listDatabases |
readWriteAnyDatabase |
提供所有資料庫讀寫權限:readWrite 列出叢集所有資料庫:listDatabases |
userAdminAnyDatabase |
提供所有使用者資料管理許可權:userAdmin Cluster:authSchemaUpgrade,invalidateUserCache,listDatabases admin.system.users和admin.system.roles: collStats,dbHash,dbStats,find,killCursors,planCacheRead createIndex,dropIndex |
dbAdminAnyDatabase |
提供所有資料庫管理員許可權:dbAdmin 列出叢集所有資料庫:listDatabases |
Superuser Roles |
root |
角色:dbOwner,userAdmin,userAdminAnyDatabase readWriteAnyDatabase, dbAdminAnyDatabase, userAdminAnyDatabase,clusterAdmin |
Internal Role |
__system |
叢集中對任何資料庫採取任何操作 |