summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session_for_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/auth/authorization_session_for_test.cpp')
-rw-r--r--src/mongo/db/auth/authorization_session_for_test.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/auth/authorization_session_for_test.cpp b/src/mongo/db/auth/authorization_session_for_test.cpp
index 620716c5e4f..e88dd65ebc4 100644
--- a/src/mongo/db/auth/authorization_session_for_test.cpp
+++ b/src/mongo/db/auth/authorization_session_for_test.cpp
@@ -48,7 +48,8 @@ void AuthorizationSessionForTest::assumePrivilegesForDB(Privilege privilege, Str
void AuthorizationSessionForTest::assumePrivilegesForDB(PrivilegeVector privileges,
StringData dbName) {
- _authenticatedUser = UserHandle(User(UserName("authorizationSessionForTestUser", dbName)));
+ UserRequest request(UserName("authorizationSessionForTestUser"_sd, dbName), boost::none);
+ _authenticatedUser = UserHandle(User(request));
_authenticatedUser.value()->addPrivileges(privileges);
_authenticationMode = AuthorizationSession::AuthenticationMode::kConnection;
_updateInternalAuthorizationState();