0
点赞
收藏
分享

微信扫一扫

Mongodb 用户权限列表

梦想家们 2022-07-14 阅读 60


 

 

Mongodb 用户权限列表_db.getRole

db.getRole('dbAdminAnyDatabase',{showPrivileges:true}) 查看某个权限可以做什么

shard_0:PRIMARY> db.getRole("dbAdminAnyDatabase",{showPrivileges:true})
{
"role" : "dbAdminAnyDatabase",
"db" : "admin",
"isBuiltin" : true,
"roles" : [ ],
"inheritedRoles" : [ ],
"privileges" : [
{
"resource" : {
"cluster" : true
},
"actions" : [
"listDatabases"
]
},
{
"resource" : {
"db" : "",
"collection" : ""
},
"actions" : [
"collMod",
"collStats",
"compact",
"convertToCapped",
"createCollection",
"createIndex",
"dbStats",
"dropCollection",
"dropDatabase",
"dropIndex",
"enableProfiler",
"indexStats",
"listCollections",
"listIndexes",
"planCacheIndexFilter",
"planCacheRead",
"planCacheWrite",
"reIndex",
"renameCollectionSameDB",
"repairDatabase",
"storageDetails",
"validate"
]
},
{
"resource" : {
"db" : "",
"collection" : "system.indexes"
},
"actions" : [
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "",
"collection" : "system.namespaces"
},
"actions" : [
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "",
"collection" : "system.profile"
},
"actions" : [
"collStats",
"convertToCapped",
"createCollection",
"dbHash",
"dbStats",
"dropCollection",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
}
],
"inheritedPrivileges" : [
{
"resource" : {
"cluster" : true
},
"actions" : [
"listDatabases"
]
},
{
"resource" : {
"db" : "",
"collection" : ""
},
"actions" : [
"collMod",
"collStats",
"compact",
"convertToCapped",
"createCollection",
"createIndex",
"dbStats",
"dropCollection",
"dropDatabase",
"dropIndex",
"enableProfiler",
"indexStats",
"listCollections",
"listIndexes",
"planCacheIndexFilter",
"planCacheRead",
"planCacheWrite",
"reIndex",
"renameCollectionSameDB",
"repairDatabase",
"storageDetails",
"validate"
]
},
{
"resource" : {
"db" : "",
"collection" : "system.indexes"
},
"actions" : [
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "",
"collection" : "system.namespaces"
},
"actions" : [
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "",
"collection" : "system.profile"
},
"actions" : [
"collStats",
"convertToCapped",
"createCollection",
"dbHash",
"dbStats",
"dropCollection",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
}
]
}

 

举报

相关推荐

0 条评论