File tree 4 files changed +43
-4
lines changed
src/Adapters/Storage/Mongo
4 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 3
3
### master
4
4
[ Full Changelog] ( https://github.com/parse-community/parse-server/compare/2.7.0...master )
5
5
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
+
6
13
### 2.7.0
7
14
[ Full Changelog] ( https://github.com/parse-community/parse-server/compare/2.7.0...2.6.5 )
8
15
16
+ :warning : This version contains an issue affecting Class Level Permissions on mongoDB. Please upgrade to 2.7.1.
17
+
9
18
Starting parse-server 2.7.0, the minimun nodejs version is 6.11.4, please update your engines before updating parse-server
10
19
11
20
#### New Features:
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " parse-server" ,
3
- "version" : " 2.7.0 " ,
3
+ "version" : " 2.7.1 " ,
4
4
"description" : " An express module providing a Parse-compatible API server" ,
5
5
"main" : " lib/index.js" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change 2
2
3
3
var Parse = require ( 'parse/node' ) . Parse ;
4
4
var request = require ( 'request' ) ;
5
+ const rp = require ( 'request-promise' ) ;
5
6
var dd = require ( 'deep-diff' ) ;
6
7
var Config = require ( '../src/Config' ) ;
7
8
@@ -1721,6 +1722,35 @@ describe('schemas', () => {
1721
1722
} ) ;
1722
1723
} ) ;
1723
1724
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
+
1724
1754
it ( 'regression test for #2246' , done => {
1725
1755
const profile = new Parse . Object ( 'UserProfile' ) ;
1726
1756
const user = new Parse . User ( ) ;
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ export class MongoStorageAdapter {
166
166
setClassLevelPermissions ( className , CLPs ) {
167
167
return this . _schemaCollection ( )
168
168
. then ( schemaCollection => schemaCollection . updateSchema ( className , {
169
- $set : { _metadata : { class_permissions : CLPs } }
169
+ $set : { ' _metadata. class_permissions' : CLPs }
170
170
} ) ) ;
171
171
}
172
172
@@ -212,7 +212,7 @@ export class MongoStorageAdapter {
212
212
. then ( ( ) => insertPromise )
213
213
. then ( ( ) => this . _schemaCollection ( ) )
214
214
. then ( schemaCollection => schemaCollection . updateSchema ( className , {
215
- $set : { _metadata : { indexes : existingIndexes } }
215
+ $set : { ' _metadata. indexes' : existingIndexes }
216
216
} ) ) ;
217
217
}
218
218
@@ -231,7 +231,7 @@ export class MongoStorageAdapter {
231
231
} , { } ) ;
232
232
return this . _schemaCollection ( )
233
233
. then ( schemaCollection => schemaCollection . updateSchema ( className , {
234
- $set : { _metadata : { indexes : indexes } }
234
+ $set : { ' _metadata. indexes' : indexes }
235
235
} ) ) ;
236
236
} ) . catch ( ( ) => {
237
237
// Ignore if collection not found
You can’t perform that action at this time.
0 commit comments