Skip to content

Commit 1f22ee3

Browse files
authored
⚡ Release 2.7.1
(#4410) * Adds failing test for 4409 * Adds fix * ⚡ Release 2.7.1
1 parent ca542c3 commit 1f22ee3

File tree

4 files changed

+43
-4
lines changed

4 files changed

+43
-4
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@
33
### master
44
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.7.0...master)
55

6+
### 2.7.1
7+
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.7.1...2.7.0)
8+
9+
:warning: Fixes a security issue affecting Class Level Permissions
10+
11+
* Adds support for dot notation when using matchesKeyInQuery, thanks to [Henrik](https://github.com/bohemima) and [Arthur Cinader](https://github.com/acinader)
12+
613
### 2.7.0
714
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.7.0...2.6.5)
815

16+
:warning: This version contains an issue affecting Class Level Permissions on mongoDB. Please upgrade to 2.7.1.
17+
918
Starting parse-server 2.7.0, the minimun nodejs version is 6.11.4, please update your engines before updating parse-server
1019

1120
#### New Features:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

spec/schemas.spec.js

+30
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var Parse = require('parse/node').Parse;
44
var request = require('request');
5+
const rp = require('request-promise');
56
var dd = require('deep-diff');
67
var Config = require('../src/Config');
78

@@ -1721,6 +1722,35 @@ describe('schemas', () => {
17211722
});
17221723
});
17231724

1725+
1726+
it("regression test for #4409 (indexes override the clp)", done => {
1727+
setPermissionsOnClass('_Role', {
1728+
'get': {"*": true},
1729+
'find': {"*": true},
1730+
'create': {'*': true},
1731+
}, true).then(() => {
1732+
const config = Config.get('test');
1733+
return config.database.adapter.updateSchemaWithIndexes();
1734+
}).then(() => {
1735+
return rp.get({
1736+
url: 'http://localhost:8378/1/schemas/_Role',
1737+
headers: masterKeyHeaders,
1738+
json: true,
1739+
});
1740+
}).then((res) => {
1741+
expect(res.classLevelPermissions).toEqual({
1742+
'get': {"*": true},
1743+
'find': {"*": true},
1744+
'create': {'*': true},
1745+
'update': {},
1746+
'delete': {},
1747+
'addField': {},
1748+
});
1749+
console.log(res);
1750+
}).then(done).catch(done.fail);
1751+
});
1752+
1753+
17241754
it('regression test for #2246', done => {
17251755
const profile = new Parse.Object('UserProfile');
17261756
const user = new Parse.User();

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class MongoStorageAdapter {
166166
setClassLevelPermissions(className, CLPs) {
167167
return this._schemaCollection()
168168
.then(schemaCollection => schemaCollection.updateSchema(className, {
169-
$set: { _metadata: { class_permissions: CLPs } }
169+
$set: { '_metadata.class_permissions': CLPs }
170170
}));
171171
}
172172

@@ -212,7 +212,7 @@ export class MongoStorageAdapter {
212212
.then(() => insertPromise)
213213
.then(() => this._schemaCollection())
214214
.then(schemaCollection => schemaCollection.updateSchema(className, {
215-
$set: { _metadata: { indexes: existingIndexes } }
215+
$set: { '_metadata.indexes': existingIndexes }
216216
}));
217217
}
218218

@@ -231,7 +231,7 @@ export class MongoStorageAdapter {
231231
}, {});
232232
return this._schemaCollection()
233233
.then(schemaCollection => schemaCollection.updateSchema(className, {
234-
$set: { _metadata: { indexes: indexes } }
234+
$set: { '_metadata.indexes': indexes }
235235
}));
236236
}).catch(() => {
237237
// Ignore if collection not found

0 commit comments

Comments
 (0)