File tree Expand file tree Collapse file tree 4 files changed +43
-4
lines changed
src/Adapters/Storage/Mongo Expand file tree Collapse file tree 4 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 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+
918Starting 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:
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 22
33var Parse = require ( 'parse/node' ) . Parse ;
44var request = require ( 'request' ) ;
5+ const rp = require ( 'request-promise' ) ;
56var dd = require ( 'deep-diff' ) ;
67var 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 ( ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments