diff options
author | Andy Schwerin <schwerin@10gen.com> | 2013-10-06 13:47:22 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2013-10-06 16:25:25 -0400 |
commit | 3a122656855ca33ee3ee84744b6d413ed30ade04 (patch) | |
tree | 3073cec68964d7553fc882d472094c8466c41148 /src/mongo/db/mongod_options.cpp | |
parent | 4f481600f817f5d3c6d2c1cee74e3c133c453681 (diff) | |
download | mongo-3a122656855ca33ee3ee84744b6d413ed30ade04.tar.gz |
SERVER-10670 Make isAuthEnabled a member rather than static function of AuthorizationManager.
It should have been from the beginning, and fixing it makes it easier to
write tests.
Diffstat (limited to 'src/mongo/db/mongod_options.cpp')
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index 5f9a5b489f3..0f3c83ba982 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -35,6 +35,7 @@ #include "mongo/base/status.h" #include "mongo/bson/util/builder.h" #include "mongo/db/auth/authorization_manager.h" +#include "mongo/db/auth/authorization_manager_global.h" #include "mongo/db/instance.h" #include "mongo/db/module.h" #include "mongo/db/pdfile.h" @@ -479,10 +480,10 @@ namespace mongo { serverGlobalParams.cpu = true; } if (params.count("noauth")) { - AuthorizationManager::setAuthEnabled(false); + getGlobalAuthorizationManager()->setAuthEnabled(false); } if (params.count("auth")) { - AuthorizationManager::setAuthEnabled(true); + getGlobalAuthorizationManager()->setAuthEnabled(true); } if (params.count("quota")) { storageGlobalParams.quota = true; @@ -782,7 +783,9 @@ namespace mongo { } MONGO_INITIALIZER_GENERAL(ParseStartupConfiguration, - ("GlobalLogManager"), + ("GlobalLogManager", + "CreateAuthorizationManager" // Requried to call getGlobalAuthorizationManager(). + ), ("default", "completedStartupConfig"))(InitializerContext* context) { serverOptions = moe::OptionSection("Allowed options"); |