diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2014-09-18 13:57:44 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2014-09-18 20:25:53 -0400 |
commit | 8218e483ed31b5d8392a62cb1bc8c402e8ed0e97 (patch) | |
tree | f79cd44d84ab7fe9bb21f1d60b7627cc06e9d6b7 /src/mongo/db/auth/authz_manager_external_state_mock.cpp | |
parent | 3a0420f1a74cbeefadc7909dbf2e1768200708eb (diff) | |
download | mongo-8218e483ed31b5d8392a62cb1bc8c402e8ed0e97.tar.gz |
SERVER-15311 Never read from admin.system.new_users when looking for user documents.
The master branch no longer needs to support the 2.4-2.6 upgrade process, obviating the need for
this decision making. Removing it will reduce the likelihood of future errors, and simplifies
storage concurrency control by removing the need for a multi-document atomic read.
Diffstat (limited to 'src/mongo/db/auth/authz_manager_external_state_mock.cpp')
-rw-r--r-- | src/mongo/db/auth/authz_manager_external_state_mock.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state_mock.cpp b/src/mongo/db/auth/authz_manager_external_state_mock.cpp index 1c41763072c..d563feca2f1 100644 --- a/src/mongo/db/auth/authz_manager_external_state_mock.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_mock.cpp @@ -100,39 +100,6 @@ namespace { BSONObj())); } - Status AuthzManagerExternalStateMock::_getUserDocument(OperationContext* txn, - const UserName& userName, - BSONObj* userDoc) { - int authzVersion; - Status status = getStoredAuthorizationVersion(txn, &authzVersion); - if (!status.isOK()) - return status; - - switch (authzVersion) { - case AuthorizationManager::schemaVersion26Upgrade: - case AuthorizationManager::schemaVersion26Final: - break; - default: - return Status(ErrorCodes::AuthSchemaIncompatible, mongoutils::str::stream() << - "Unsupported schema version for getUserDescription(): " << - authzVersion); - } - - status = findOne( - txn, - (authzVersion == AuthorizationManager::schemaVersion26Final ? - AuthorizationManager::usersCollectionNamespace : - AuthorizationManager::usersAltCollectionNamespace), - BSON(AuthorizationManager::USER_NAME_FIELD_NAME << userName.getUser() << - AuthorizationManager::USER_DB_FIELD_NAME << userName.getDB()), - userDoc); - if (status == ErrorCodes::NoMatchingDocument) { - status = Status(ErrorCodes::UserNotFound, mongoutils::str::stream() << - "Could not find user " << userName.getFullName()); - } - return status; - } - Status AuthzManagerExternalStateMock::getAllDatabaseNames( OperationContext* txn, std::vector<std::string>* dbnames) { |