summaryrefslogtreecommitdiff
path: root/jstests/auth/auth1.js
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-07-11 11:33:07 -0400
committerAndy Schwerin <schwerin@10gen.com>2013-07-17 14:35:14 -0400
commitf62d600cb0a2680b72a35023e812140da50056ca (patch)
tree6ca8c83413239e55ee287b77d0d9a2766eadf739 /jstests/auth/auth1.js
parent354a844c45a2d3734cdce0f22525bb8fe5de37a1 (diff)
downloadmongo-f62d600cb0a2680b72a35023e812140da50056ca.tar.gz
SERVER-1891 Consolidate command authorization checking logic.
This reverts commit 2e2a6fdffdba369a0594962267e5bc7bb47a3f3a and also fixes the build break that the original "Consolidate command authorization checking logic" patch introduced.
Diffstat (limited to 'jstests/auth/auth1.js')
-rw-r--r--jstests/auth/auth1.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/jstests/auth/auth1.js b/jstests/auth/auth1.js
index 0a995ea9655..ad5a579feb8 100644
--- a/jstests/auth/auth1.js
+++ b/jstests/auth/auth1.js
@@ -26,9 +26,11 @@ db.getSisterDB( "admin" ).addUser( "super", "super" );
assert.throws( function() { t.findOne() }, [], "read without login" );
print("make sure we can't run certain commands w/out auth");
-var errmsg = "unauthorized";
-assert.eq(db.runCommand({eval : "function() { return 1; }"}).errmsg, errmsg);
-assert.eq(db.adminCommand({getLog : "global"}).errmsg, errmsg);
+var codeUnauthorized = 13;
+var rslt = db.runCommand({eval : "function() { return 1; }"});
+assert.eq(rslt.code, codeUnauthorized, tojson(rslt));
+var rslt = db.runCommand({getLog : "global"});
+assert.eq(rslt.code, codeUnauthorized, tojson(rslt));
assert(!db.auth("eliot", "eliot2"), "auth succeeded with wrong password");
assert(db.auth("eliot", "eliot"), "auth failed");