diff options
author | Spencer T Brody <spencer@10gen.com> | 2012-12-19 17:49:20 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2012-12-20 12:48:07 -0500 |
commit | f02beea38e12b79fc10afcf2b3d39a003b3c3821 (patch) | |
tree | 028e2d704a7509801e5ea5e7b6eea86cf178c997 /src/mongo/db/dbeval.cpp | |
parent | d920d6bf42a45926da0909854fe72e1d391e1611 (diff) | |
download | mongo-f02beea38e12b79fc10afcf2b3d39a003b3c3821.tar.gz |
SERVER-7572 Remove more old-style authorization checks
Diffstat (limited to 'src/mongo/db/dbeval.cpp')
-rw-r--r-- | src/mongo/db/dbeval.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mongo/db/dbeval.cpp b/src/mongo/db/dbeval.cpp index 2ca84ed87e5..4848279ebe3 100644 --- a/src/mongo/db/dbeval.cpp +++ b/src/mongo/db/dbeval.cpp @@ -122,19 +122,11 @@ namespace mongo { } CmdEval() : Command("eval", false, "$eval") { } bool run(const string& dbname , BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) { - - AuthenticationInfo *ai = cc().getAuthenticationInfo(); - uassert( 12598 , "$eval reads unauthorized", ai->isAuthorizedReads(dbname.c_str()) ); - if ( cmdObj["nolock"].trueValue() ) { return dbEval(dbname, cmdObj, result, errmsg); } - // write security will be enforced in DBDirectClient - // TODO: should this be a db lock? - scoped_ptr<Lock::ScopedLock> lk( ai->isAuthorized( dbname.c_str() ) ? - static_cast<Lock::ScopedLock*>( new Lock::GlobalWrite() ) : - static_cast<Lock::ScopedLock*>( new Lock::GlobalRead() ) ); + Lock::GlobalWrite lk; Client::Context ctx( dbname ); return dbEval(dbname, cmdObj, result, errmsg); |