diff options
author | Militsa Sotirova <militsa.sotirova@mongodb.com> | 2023-02-28 20:04:48 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-03-01 00:58:25 +0000 |
commit | 1322159a597ab966087605ecd0c67e0f55f30340 (patch) | |
tree | 93e8dc43ef87aad6ae047fa91bfd9943c07a508c /src/mongo/db/commands | |
parent | 84a26a67939518c943dba5263660652aeeb99b64 (diff) | |
download | mongo-1322159a597ab966087605ecd0c67e0f55f30340.tar.gz |
SERVER-72836 Adding USER_ROLES variable and tests
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/commands/run_aggregate.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 7e901098cdb..7d42b2ee70e 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -131,6 +131,9 @@ boost::intrusive_ptr<ExpressionContext> makeExpressionContext( expCtx->tempDir = storageGlobalParams.dbpath + "/_tmp"; expCtx->startExpressionCounters(); + // Set the value of $$USER_ROLES for the find command. + expCtx->setUserRoles(); + return expCtx; } diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index d0bd10e4e71..d21f9801319 100644 --- a/src/mongo/db/commands/run_aggregate.cpp +++ b/src/mongo/db/commands/run_aggregate.cpp @@ -458,6 +458,9 @@ boost::intrusive_ptr<ExpressionContext> makeExpressionContext( expCtx->changeStreamTokenVersion = 1; } + // Set the value of $$USER_ROLES for the aggregation. + expCtx->setUserRoles(); + return expCtx; } |