diff options
author | David Storch <david.storch@10gen.com> | 2015-04-02 14:56:36 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-04-02 16:28:49 -0400 |
commit | 93bc8652f4bb8a4accd2ddd7afc25a8a117d1c36 (patch) | |
tree | 4e8675f257b794395d07065902f5f60d6b4cae0d /jstests/auth | |
parent | 736faefc2822289ad0dc9be90029e76dea9615f3 (diff) | |
download | mongo-93bc8652f4bb8a4accd2ddd7afc25a8a117d1c36.tar.gz |
SERVER-17764 extend commands authorization test for find and getMore commands
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/lib/commands_lib.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js index 14299d2f5e9..8e8f22b2363 100644 --- a/jstests/auth/lib/commands_lib.js +++ b/jstests/auth/lib/commands_lib.js @@ -1083,6 +1083,27 @@ var authCommandsLib = { ] }, { + testname: "find", + command: {find: "foo"}, + skipSharded: true, // TODO: remove when find command is implemented in mongos + testcases: [ + { + runOnDb: firstDbName, + roles: roles_read, + privileges: [ + { resource: {db: firstDbName, collection: "foo"}, actions: ["find"] } + ] + }, + { + runOnDb: secondDbName, + roles: roles_readAny, + privileges: [ + { resource: {db: secondDbName, collection: "foo"}, actions: ["find"] } + ] + } + ] + }, + { testname: "findAndModify", command: {findAndModify: "x", query: {_id: "abc"}, update: {$inc: {n: 1}}}, setup: function (db) { @@ -1252,6 +1273,29 @@ var authCommandsLib = { ] }, { + testname: "getMore", + command: {getMore: NumberLong("1"), collection: "foo"}, + skipSharded: true, // TODO: remove when getMore command is implemented in mongos + testcases: [ + { + runOnDb: firstDbName, + roles: roles_read, + privileges: [ + { resource: {db: firstDbName, collection: "foo"}, actions: ["find"] } + ], + expectFail: true + }, + { + runOnDb: secondDbName, + roles: roles_readAny, + privileges: [ + { resource: {db: secondDbName, collection: "foo"}, actions: ["find"] } + ], + expectFail: true + } + ] + }, + { testname: "getnonce", command: {getnonce: 1}, testcases: [ |