summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/list_collections.cpp
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2019-01-07 03:57:07 +0000
committerKevin Pulo <kevin.pulo@mongodb.com>2019-05-08 06:17:41 +0000
commit89fb6dcc3e87fca01bbea2a7662d33f6f2c4702d (patch)
tree226f6ab2683c952f0be3b0c08771b67e18cb0603 /src/mongo/db/commands/list_collections.cpp
parent401a54fb7a03c0a09a7c36c8ceb91489fe600204 (diff)
downloadmongo-89fb6dcc3e87fca01bbea2a7662d33f6f2c4702d.tar.gz
SERVER-38867 refine handling of system collections in listCollections
Diffstat (limited to 'src/mongo/db/commands/list_collections.cpp')
-rw-r--r--src/mongo/db/commands/list_collections.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp
index 3e715d3a69a..2e1c8fece35 100644
--- a/src/mongo/db/commands/list_collections.cpp
+++ b/src/mongo/db/commands/list_collections.cpp
@@ -305,9 +305,8 @@ public:
// Only validate on a per-collection basis if the user requested
// a list of authorized collections
if (authorizedCollections &&
- (nss.coll().startsWith("system.") ||
- !as->isAuthorizedForAnyActionOnResource(
- ResourcePattern::forExactNamespace(nss)))) {
+ (!as->isAuthorizedForAnyActionOnResource(
+ ResourcePattern::forExactNamespace(nss)))) {
continue;
}
@@ -327,9 +326,8 @@ public:
MODE_IS,
[&](Collection* collection, CollectionCatalogEntry* catalogEntry) {
if (authorizedCollections &&
- (collection->ns().coll().startsWith("system.") ||
- !as->isAuthorizedForAnyActionOnResource(
- ResourcePattern::forExactNamespace(collection->ns())))) {
+ (!as->isAuthorizedForAnyActionOnResource(
+ ResourcePattern::forExactNamespace(collection->ns())))) {
return true;
}
BSONObj collBson = buildCollectionBson(