我最近4.2.0
从4.0.2
. 在以前的版本中,用户可以访问 system.indexes,但升级后,用户无法访问 system.indexes 集合。用户已经具有读写角色。另外,我尝试给 dbAdmin 但仍然没有运气。
为 mongo 启用调试日志后,它向我显示not authorized for query on testdb.system.indexes src/mongo/db/commands/find_cmd.cpp 170
.
有人遇到过这个问题吗?
下面是输出
{
"role" : "read",
"db" : "testdb",
"isBuiltin" : true,
"roles" : [ ],
"inheritedRoles" : [ ],
"privileges" : [
{
"resource" : {
"db" : "testdb",
"collection" : ""
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "testdb",
"collection" : "system.js"
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
}
],
"inheritedPrivileges" : [
{
"resource" : {
"db" : "testdb",
"collection" : ""
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "testdb",
"collection" : "system.js"
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
}
]
}