Skip to content

⚡ Release 2.7.1 #4410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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