summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/auth/authorization_session_impl.cpp')
-rw-r--r--src/mongo/db/auth/authorization_session_impl.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/auth/authorization_session_impl.cpp b/src/mongo/db/auth/authorization_session_impl.cpp
index 07ef4bf6a25..73c2feb31b2 100644
--- a/src/mongo/db/auth/authorization_session_impl.cpp
+++ b/src/mongo/db/auth/authorization_session_impl.cpp
@@ -36,6 +36,7 @@
#include <string>
#include <vector>
+#include "mongo/base/shim.h"
#include "mongo/base/status.h"
#include "mongo/db/auth/action_set.h"
#include "mongo/db/auth/action_type.h"
@@ -61,14 +62,18 @@ namespace mongo {
namespace dps = ::mongo::dotted_path_support;
using std::vector;
-MONGO_REGISTER_SHIM(AuthorizationSession::create)
-(AuthorizationManager* authzManager)->std::unique_ptr<AuthorizationSession> {
+namespace {
+
+std::unique_ptr<AuthorizationSession> authorizationSessionCreateImpl(
+ AuthorizationManager* authzManager) {
return std::make_unique<AuthorizationSessionImpl>(
AuthzSessionExternalState::create(authzManager),
AuthorizationSessionImpl::InstallMockForTestingOrAuthImpl{});
}
-namespace {
+auto authorizationSessionCreateRegistration =
+ MONGO_WEAK_FUNCTION_REGISTRATION(AuthorizationSession::create, authorizationSessionCreateImpl);
+
constexpr StringData ADMIN_DBNAME = "admin"_sd;
// Checks if this connection has the privileges necessary to create or modify the view 'viewNs'