diff options
Diffstat (limited to 'src/mongo/db/auth/authz_session_external_state_d.cpp')
-rw-r--r-- | src/mongo/db/auth/authz_session_external_state_d.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/mongo/db/auth/authz_session_external_state_d.cpp b/src/mongo/db/auth/authz_session_external_state_d.cpp index 65f30b5ce75..dee99046240 100644 --- a/src/mongo/db/auth/authz_session_external_state_d.cpp +++ b/src/mongo/db/auth/authz_session_external_state_d.cpp @@ -43,29 +43,28 @@ namespace mongo { - AuthzSessionExternalStateMongod::AuthzSessionExternalStateMongod( - AuthorizationManager* authzManager) : - AuthzSessionExternalStateServerCommon(authzManager) {} - AuthzSessionExternalStateMongod::~AuthzSessionExternalStateMongod() {} +AuthzSessionExternalStateMongod::AuthzSessionExternalStateMongod(AuthorizationManager* authzManager) + : AuthzSessionExternalStateServerCommon(authzManager) {} +AuthzSessionExternalStateMongod::~AuthzSessionExternalStateMongod() {} - void AuthzSessionExternalStateMongod::startRequest(OperationContext* txn) { - // No locks should be held as this happens before any database accesses occur - dassert(!txn->lockState()->isLocked()); +void AuthzSessionExternalStateMongod::startRequest(OperationContext* txn) { + // No locks should be held as this happens before any database accesses occur + dassert(!txn->lockState()->isLocked()); - _checkShouldAllowLocalhost(txn); - } + _checkShouldAllowLocalhost(txn); +} - bool AuthzSessionExternalStateMongod::shouldIgnoreAuthChecks() const { - // TODO(spencer): get "isInDirectClient" from OperationContext - return cc().isInDirectClient() || - AuthzSessionExternalStateServerCommon::shouldIgnoreAuthChecks(); - } +bool AuthzSessionExternalStateMongod::shouldIgnoreAuthChecks() const { + // TODO(spencer): get "isInDirectClient" from OperationContext + return cc().isInDirectClient() || + AuthzSessionExternalStateServerCommon::shouldIgnoreAuthChecks(); +} - bool AuthzSessionExternalStateMongod::serverIsArbiter() const { - // Arbiters have access to extra privileges under localhost. See SERVER-5479. - return (repl::getGlobalReplicationCoordinator()->getReplicationMode() == +bool AuthzSessionExternalStateMongod::serverIsArbiter() const { + // Arbiters have access to extra privileges under localhost. See SERVER-5479. + return (repl::getGlobalReplicationCoordinator()->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet && - repl::getGlobalReplicationCoordinator()->getMemberState().arbiter()); - } + repl::getGlobalReplicationCoordinator()->getMemberState().arbiter()); +} -} // namespace mongo +} // namespace mongo |