diff options
author | jannaerin <golden.janna@gmail.com> | 2021-12-22 23:45:59 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-18 20:42:45 +0000 |
commit | fcdbc3e8e383f0865b05189665a5a0524169b3bf (patch) | |
tree | 2e5f29e9f5dca998c7e593f6bd8a0b51bef869b5 /src/mongo/db/commands/user_management_commands.cpp | |
parent | 6bc31230f0cd0de66f02268c5ce0920c4f27effe (diff) | |
download | mongo-fcdbc3e8e383f0865b05189665a5a0524169b3bf.tar.gz |
SERVER-62239 Put tenantId on opCtx if passed as $tenant
Diffstat (limited to 'src/mongo/db/commands/user_management_commands.cpp')
-rw-r--r-- | src/mongo/db/commands/user_management_commands.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index 2a5f37ae267..a9a08d44856 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -65,6 +65,7 @@ #include "mongo/db/curop.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/jsobj.h" +#include "mongo/db/multitenancy.h" #include "mongo/db/operation_context.h" #include "mongo/db/ops/write_ops.h" #include "mongo/db/pipeline/aggregation_request_helper.h" @@ -1020,7 +1021,7 @@ void CmdUMCTyped<CreateUserCommand>::Invocation::typedRun(OperationContext* opCt uassert(ErrorCodes::BadValue, "Username cannot contain NULL characters", cmd.getCommandParameter().find('\0') == std::string::npos); - UserName userName(cmd.getCommandParameter(), dbname, cmd.getTenantOverride()); + UserName userName(cmd.getCommandParameter(), dbname, getActiveTenant(opCtx)); uassert(ErrorCodes::BadValue, "Must provide a 'pwd' field for all user documents, except those" |