Skip to content

Commit

Permalink
⚡ Release 2.7.1
Browse files Browse the repository at this point in the history
(#4410)
* Adds failing test for 4409

* Adds fix

* ⚡ Release 2.7.1
  • Loading branch information
flovilmart authored Dec 1, 2017
1 parent ca542c3 commit 1f22ee3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
### master
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.7.0...master)

### 2.7.1
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.7.1...2.7.0)

:warning: Fixes a security issue affecting Class Level Permissions

* Adds support for dot notation when using matchesKeyInQuery, thanks to [Henrik](https://github.com/bohemima) and [Arthur Cinader](https://github.com/acinader)

### 2.7.0
[Full Changelog](https://github.com/parse-community/parse-server/compare/2.7.0...2.6.5)

:warning: This version contains an issue affecting Class Level Permissions on mongoDB. Please upgrade to 2.7.1.

Starting parse-server 2.7.0, the minimun nodejs version is 6.11.4, please update your engines before updating parse-server

#### New Features:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-server",
"version": "2.7.0",
"version": "2.7.1",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
Expand Down
30 changes: 30 additions & 0 deletions spec/schemas.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var Parse = require('parse/node').Parse;
var request = require('request');
const rp = require('request-promise');
var dd = require('deep-diff');
var Config = require('../src/Config');

Expand Down Expand Up @@ -1721,6 +1722,35 @@ describe('schemas', () => {
});
});


it("regression test for #4409 (indexes override the clp)", done => {
setPermissionsOnClass('_Role', {
'get': {"*": true},
'find': {"*": true},
'create': {'*': true},
}, true).then(() => {
const config = Config.get('test');
return config.database.adapter.updateSchemaWithIndexes();
}).then(() => {
return rp.get({
url: 'http://localhost:8378/1/schemas/_Role',
headers: masterKeyHeaders,
json: true,
});
}).then((res) => {
expect(res.classLevelPermissions).toEqual({
'get': {"*": true},
'find': {"*": true},
'create': {'*': true},
'update': {},
'delete': {},
'addField': {},
});
console.log(res);
}).then(done).catch(done.fail);
});


it('regression test for #2246', done => {
const profile = new Parse.Object('UserProfile');
const user = new Parse.User();
Expand Down
6 changes: 3 additions & 3 deletions src/Adapters/Storage/Mongo/MongoStorageAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class MongoStorageAdapter {
setClassLevelPermissions(className, CLPs) {
return this._schemaCollection()
.then(schemaCollection => schemaCollection.updateSchema(className, {
$set: { _metadata: { class_permissions: CLPs } }
$set: { '_metadata.class_permissions': CLPs }
}));
}

Expand Down Expand Up @@ -212,7 +212,7 @@ export class MongoStorageAdapter {
.then(() => insertPromise)
.then(() => this._schemaCollection())
.then(schemaCollection => schemaCollection.updateSchema(className, {
$set: { _metadata: { indexes: existingIndexes } }
$set: { '_metadata.indexes': existingIndexes }
}));
}

Expand All @@ -231,7 +231,7 @@ export class MongoStorageAdapter {
}, {});
return this._schemaCollection()
.then(schemaCollection => schemaCollection.updateSchema(className, {
$set: { _metadata: { indexes: indexes } }
$set: { '_metadata.indexes': indexes }
}));
}).catch(() => {
// Ignore if collection not found
Expand Down

0 comments on commit 1f22ee3

Please sign in to comment.