diff options
author | Randolph Tan <randolph@10gen.com> | 2017-11-21 13:00:05 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2017-11-22 10:23:50 -0500 |
commit | a9d80bdbe5fa83ab72509958aa4788e20a6b07ef (patch) | |
tree | 0f925da65307fcc703744c04342c66e02f102a3b /jstests/core/create_indexes.js | |
parent | 2b8adbc5880d9c55a813b7b2b03a503c82a31648 (diff) | |
download | mongo-a9d80bdbe5fa83ab72509958aa4788e20a6b07ef.tar.gz |
SERVER-32043 Disallow users from creating new indexes in config.transactions
Diffstat (limited to 'jstests/core/create_indexes.js')
-rw-r--r-- | jstests/core/create_indexes.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/jstests/core/create_indexes.js b/jstests/core/create_indexes.js index 53a8b6e68f3..e10b86a4e64 100644 --- a/jstests/core/create_indexes.js +++ b/jstests/core/create_indexes.js @@ -156,4 +156,10 @@ res = t.runCommand('createIndexes', {indexes: [{key: {star: 1}, name: '*'}]}); assert.commandFailedWithCode(res, ErrorCodes.BadValue); + // Test that user is not allowed to create indexes in config.transactions. + var configDB = db.getSiblingDB('config'); + res = configDB.runCommand( + {createIndexes: 'transactions', indexes: [{key: {star: 1}, name: 'star'}]}); + assert.commandFailedWithCode(res, ErrorCodes.IllegalOperation); + }()); |