summaryrefslogtreecommitdiff
path: root/src/mongo/db/security_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/security_common.cpp')
-rw-r--r--src/mongo/db/security_common.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/mongo/db/security_common.cpp b/src/mongo/db/security_common.cpp
index 59cb2d503d3..053faef70d6 100644
--- a/src/mongo/db/security_common.cpp
+++ b/src/mongo/db/security_common.cpp
@@ -117,42 +117,4 @@ namespace mongo {
return true;
}
- void CmdAuthenticate::authenticate(const string& dbname, const string& user, const bool readOnly) {
- ClientBasic* c = ClientBasic::getCurrent();
- verify(c);
- AuthenticationInfo *ai = c->getAuthenticationInfo();
-
- if ( readOnly ) {
- ai->authorizeReadOnly( dbname , user );
- }
- else {
- ai->authorize( dbname , user );
- }
- }
-
-
- bool AuthenticationInfo::_isAuthorized(const string& dbname, Auth::Level level) const {
- if ( noauth ) {
- return true;
- }
- {
- scoped_spinlock lk(_lock);
-
- if ( _isAuthorizedSingle_inlock( dbname , level ) )
- return true;
-
- if ( _isAuthorizedSingle_inlock( "admin" , level ) )
- return true;
-
- if ( _isAuthorizedSingle_inlock( "local" , level ) )
- return true;
- }
- return _isAuthorizedSpecialChecks( dbname );
- }
-
- bool AuthenticationInfo::_isAuthorizedSingle_inlock(const string& dbname, Auth::Level level) const {
- const AuthenticationTable& authTable = _usingTempAuth ? _tempAuthTable : _authTable;
- return authTable.getAuthForDb( dbname ).level >= level;
- }
-
} // namespace mongo