diff options
author | samontea <merciers.merciers@gmail.com> | 2021-02-08 19:00:08 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-08 21:18:33 +0000 |
commit | 6a5e743910ad6b2d9aea53aae046b2a0b63d3198 (patch) | |
tree | 65d4b37df29bc0cc1530513fc5d1d684339ab24f /src/mongo/db/auth | |
parent | 19940de8b056ec9441c97f824e7adc508b444a40 (diff) | |
download | mongo-6a5e743910ad6b2d9aea53aae046b2a0b63d3198.tar.gz |
SERVER-53127 Let AggregationRequestHelper::parseFromBSON() return an AggregateCommand
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r-- | src/mongo/db/auth/authorization_session_impl.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/db/auth/authorization_session_impl.cpp b/src/mongo/db/auth/authorization_session_impl.cpp index 9b54154225e..0f131648506 100644 --- a/src/mongo/db/auth/authorization_session_impl.cpp +++ b/src/mongo/db/auth/authorization_session_impl.cpp @@ -90,17 +90,14 @@ Status checkAuthForCreateOrModifyView(AuthorizationSession* authzSession, return Status::OK(); } - auto status = aggregation_request_helper::parseFromBSON( + auto request = aggregation_request_helper::parseFromBSON( viewNs, BSON("aggregate" << viewOnNs.coll() << "pipeline" << viewPipeline << "cursor" << BSONObj() << "$db" << viewOnNs.db()), boost::none, false); - if (!status.isOK()) - return status.getStatus(); - auto statusWithPrivs = - authzSession->getPrivilegesForAggregate(viewOnNs, status.getValue(), isMongos); + auto statusWithPrivs = authzSession->getPrivilegesForAggregate(viewOnNs, request, isMongos); PrivilegeVector privileges = uassertStatusOK(statusWithPrivs); if (!authzSession->isAuthorizedForPrivileges(privileges)) { return Status(ErrorCodes::Unauthorized, "unauthorized"); |