mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
have read/write lock on all platforms/boost now
This commit is contained in:
parent
629a3d6115
commit
35031d43d7
@ -34,10 +34,6 @@
|
||||
|
||||
namespace mongo {
|
||||
|
||||
inline bool readLockSupported(){
|
||||
return true;
|
||||
}
|
||||
|
||||
string sayClientState();
|
||||
bool haveClient();
|
||||
|
||||
|
@ -128,7 +128,6 @@ namespace mongo {
|
||||
virtual bool readOnly(){ return true; }
|
||||
virtual LockType locktype() const { return READ; }
|
||||
virtual bool run(const string& ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl){
|
||||
result.append( "readlock" , readLockSupported() );
|
||||
if ( globalScriptEngine ){
|
||||
BSONObjBuilder bb( result.subobjStart( "js" ) );
|
||||
result.append( "utf8" , globalScriptEngine->utf8Ok() );
|
||||
|
@ -174,13 +174,7 @@ namespace mongo {
|
||||
AuthenticationInfo *ai = cc().getAuthenticationInfo();
|
||||
|
||||
if ( userObj[ "readOnly" ].isBoolean() && userObj[ "readOnly" ].boolean() ) {
|
||||
if ( readLockSupported() ){
|
||||
ai->authorizeReadOnly( cc().database()->name.c_str() );
|
||||
}
|
||||
else {
|
||||
log() << "warning: old version of boost, read-only users not supported" << endl;
|
||||
ai->authorize( cc().database()->name.c_str() );
|
||||
}
|
||||
ai->authorizeReadOnly( cc().database()->name.c_str() );
|
||||
} else {
|
||||
ai->authorize( cc().database()->name.c_str() );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user