summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/getmore_cmd.cpp
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2022-05-10 17:54:01 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-24 05:17:25 +0000
commit4fab61e9c5006e9a4c06860dc9e49e1d422ee859 (patch)
treec383da8e16d40422c3dff8dea6a38c6e2935e256 /src/mongo/db/commands/getmore_cmd.cpp
parentd3dae653da44b8cb87ff2a9687c0468aa52b6b44 (diff)
downloadmongo-4fab61e9c5006e9a4c06860dc9e49e1d422ee859.tar.gz
SERVER-66360 Remove multi-user authentication support
Diffstat (limited to 'src/mongo/db/commands/getmore_cmd.cpp')
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index a344ab03278..6aed4fb7583 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -151,10 +151,8 @@ void validateTxnNumber(OperationContext* opCtx, int64_t cursorId, const ClientCu
void validateAuthorization(const OperationContext* opCtx, const ClientCursor& cursor) {
auto authzSession = AuthorizationSession::get(opCtx->getClient());
- // A user can only call getMore on their own cursor. If there were multiple users
- // authenticated when the cursor was created, then at least one of them must be
- // authenticated in order to run getMore on the cursor.
- if (!authzSession->isCoauthorizedWith(cursor.getAuthenticatedUsers())) {
+ // A user can only call getMore on their own cursor.
+ if (!authzSession->isCoauthorizedWith(cursor.getAuthenticatedUser())) {
uasserted(ErrorCodes::Unauthorized,
str::stream() << "cursor id " << cursor.cursorid()
<< " was not created by the authenticated user");