diff options
Diffstat (limited to 'src/mongo/db/commands/group.cpp')
-rw-r--r-- | src/mongo/db/commands/group.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/commands/group.cpp b/src/mongo/db/commands/group.cpp index 6e80bbef1f6..43a1fda05fc 100644 --- a/src/mongo/db/commands/group.cpp +++ b/src/mongo/db/commands/group.cpp @@ -56,12 +56,13 @@ namespace mongo { virtual void help( stringstream &help ) const { help << "http://dochub.mongodb.org/core/aggregation"; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(OperationContext* txn, + ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj) { std::string ns = parseNs(dbname, cmdObj); if (!client->getAuthorizationSession()->isAuthorizedForActionsOnNamespace( - NamespaceString(ns), ActionType::find)) { + txn, NamespaceString(ns), ActionType::find)) { return Status(ErrorCodes::Unauthorized, "unauthorized"); } return Status::OK(); @@ -254,7 +255,7 @@ namespace mongo { finalize = p["finalize"]._asCode(); const string ns = parseNs(dbname, jsobj); - Client::ReadContext ctx(ns); + Client::ReadContext ctx(txn, ns); return group( ctx.ctx().db() , ns , q , key , keyf , reduce._asCode() , reduce.type() != CodeWScope ? 0 : reduce.codeWScopeScopeDataUnsafe() , |