diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/auth/authorization_manager_global.cpp | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/auth/authorization_manager_global.cpp')
-rw-r--r-- | src/mongo/db/auth/authorization_manager_global.cpp | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/src/mongo/db/auth/authorization_manager_global.cpp b/src/mongo/db/auth/authorization_manager_global.cpp index cc5ee6513f5..2fc20deef25 100644 --- a/src/mongo/db/auth/authorization_manager_global.cpp +++ b/src/mongo/db/auth/authorization_manager_global.cpp @@ -38,51 +38,50 @@ namespace mongo { namespace { - class AuthzVersionParameter : public ServerParameter { - MONGO_DISALLOW_COPYING(AuthzVersionParameter); - public: - AuthzVersionParameter(ServerParameterSet* sps, const std::string& name); - virtual void append(OperationContext* txn, BSONObjBuilder& b, const std::string& name); - virtual Status set(const BSONElement& newValueElement); - virtual Status setFromString(const std::string& str); - }; +class AuthzVersionParameter : public ServerParameter { + MONGO_DISALLOW_COPYING(AuthzVersionParameter); - MONGO_INITIALIZER_GENERAL(AuthzSchemaParameter, - MONGO_NO_PREREQUISITES, - ("BeginStartupOptionParsing"))(InitializerContext*) { - new AuthzVersionParameter(ServerParameterSet::getGlobal(), - authSchemaVersionServerParameter); - return Status::OK(); - } +public: + AuthzVersionParameter(ServerParameterSet* sps, const std::string& name); + virtual void append(OperationContext* txn, BSONObjBuilder& b, const std::string& name); + virtual Status set(const BSONElement& newValueElement); + virtual Status setFromString(const std::string& str); +}; - AuthzVersionParameter::AuthzVersionParameter(ServerParameterSet* sps, const std::string& name) : - ServerParameter(sps, name, false, false) {} +MONGO_INITIALIZER_GENERAL(AuthzSchemaParameter, + MONGO_NO_PREREQUISITES, + ("BeginStartupOptionParsing"))(InitializerContext*) { + new AuthzVersionParameter(ServerParameterSet::getGlobal(), authSchemaVersionServerParameter); + return Status::OK(); +} - void AuthzVersionParameter::append( - OperationContext* txn, BSONObjBuilder& b, const std::string& name) { - int authzVersion; - uassertStatusOK( - getGlobalAuthorizationManager()->getAuthorizationVersion(txn, &authzVersion)); - b.append(name, authzVersion); - } +AuthzVersionParameter::AuthzVersionParameter(ServerParameterSet* sps, const std::string& name) + : ServerParameter(sps, name, false, false) {} - Status AuthzVersionParameter::set(const BSONElement& newValueElement) { - return Status(ErrorCodes::InternalError, "set called on unsettable server parameter"); - } +void AuthzVersionParameter::append(OperationContext* txn, + BSONObjBuilder& b, + const std::string& name) { + int authzVersion; + uassertStatusOK(getGlobalAuthorizationManager()->getAuthorizationVersion(txn, &authzVersion)); + b.append(name, authzVersion); +} - Status AuthzVersionParameter::setFromString(const std::string& newValueString) { - return Status(ErrorCodes::InternalError, "set called on unsettable server parameter"); - } +Status AuthzVersionParameter::set(const BSONElement& newValueElement) { + return Status(ErrorCodes::InternalError, "set called on unsettable server parameter"); +} + +Status AuthzVersionParameter::setFromString(const std::string& newValueString) { + return Status(ErrorCodes::InternalError, "set called on unsettable server parameter"); +} } // namespace - const std::string authSchemaVersionServerParameter = "authSchemaVersion"; +const std::string authSchemaVersionServerParameter = "authSchemaVersion"; - AuthorizationManager* getGlobalAuthorizationManager() { - AuthorizationManager* globalAuthManager = AuthorizationManager::get( - getGlobalServiceContext()); - fassert(16842, globalAuthManager != nullptr); - return globalAuthManager; - } +AuthorizationManager* getGlobalAuthorizationManager() { + AuthorizationManager* globalAuthManager = AuthorizationManager::get(getGlobalServiceContext()); + fassert(16842, globalAuthManager != nullptr); + return globalAuthManager; +} -} // namespace mongo +} // namespace mongo |