summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-12-22 17:04:08 -0500
committerJames Wahlin <james.wahlin@10gen.com>2016-12-27 09:13:50 -0500
commit67257272a057635640318842ea05b28e8499f71a (patch)
treef1b9ffd2b364128a09a35560c19714e4ef582136 /src/mongo/db/auth/authorization_session.cpp
parent46daec6a95628d336762c5f78430f54d361e63c0 (diff)
downloadmongo-67257272a057635640318842ea05b28e8499f71a.tar.gz
SERVER-26734 indexStats action is not sufficient for $indexStats
Diffstat (limited to 'src/mongo/db/auth/authorization_session.cpp')
-rw-r--r--src/mongo/db/auth/authorization_session.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index ea70a82907c..fe8e8be3f18 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -261,9 +261,8 @@ Status AuthorizationSession::checkAuthForAggregate(const NamespaceString& ns,
PrivilegeVector privileges;
if (dps::extractElementAtPath(cmdObj, "pipeline.0.$indexStats")) {
- Privilege::addPrivilegeToPrivilegeVector(
- &privileges,
- Privilege(ResourcePattern::forAnyNormalResource(), ActionType::indexStats));
+ Privilege::addPrivilegeToPrivilegeVector(&privileges,
+ Privilege(inputResource, ActionType::indexStats));
} else if (dps::extractElementAtPath(cmdObj, "pipeline.0.$collStats")) {
Privilege::addPrivilegeToPrivilegeVector(&privileges,
Privilege(inputResource, ActionType::collStats));