Skip to content

Commit fc39119

Browse files
authored
Merge branch 'alpha' into alpha
2 parents ddd89c3 + 191d80b commit fc39119

File tree

5 files changed

+46
-4
lines changed

5 files changed

+46
-4
lines changed

changelogs/CHANGELOG_alpha.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [5.0.0-alpha.13](https://github.com/parse-community/parse-server/compare/5.0.0-alpha.12...5.0.0-alpha.13) (2021-12-08)
2+
3+
4+
### Bug Fixes
5+
6+
* node engine compatibility did not include node 16 ([#7739](https://github.com/parse-community/parse-server/issues/7739)) ([ea7c014](https://github.com/parse-community/parse-server/commit/ea7c01400f992a1263543706fe49b6174758a2d6))
7+
8+
# [5.0.0-alpha.12](https://github.com/parse-community/parse-server/compare/5.0.0-alpha.11...5.0.0-alpha.12) (2021-12-06)
9+
10+
11+
### Bug Fixes
12+
13+
* adding or modifying a nested property requires addField permissions ([#7679](https://github.com/parse-community/parse-server/issues/7679)) ([6a6248b](https://github.com/parse-community/parse-server/commit/6a6248b6cb2e732d17131e18e659943b894ed2f1))
14+
115
# [5.0.0-alpha.11](https://github.com/parse-community/parse-server/compare/5.0.0-alpha.10...5.0.0-alpha.11) (2021-11-29)
216

317

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "5.0.0-alpha.11",
3+
"version": "5.0.0-alpha.13",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -131,7 +131,7 @@
131131
"madge:circular": "node_modules/.bin/madge ./src --circular"
132132
},
133133
"engines": {
134-
"node": ">=12.20.0 <16"
134+
"node": ">=12.20.0 <17"
135135
},
136136
"bin": {
137137
"parse-server": "bin/parse-server"

spec/schemas.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,34 @@ describe('schemas', () => {
18661866
});
18671867
});
18681868

1869+
describe('Nested documents', () => {
1870+
beforeAll(async () => {
1871+
const testSchema = new Parse.Schema('test_7371');
1872+
testSchema.setCLP({
1873+
create: { ['*']: true },
1874+
update: { ['*']: true },
1875+
addField: {},
1876+
});
1877+
testSchema.addObject('a');
1878+
await testSchema.save();
1879+
});
1880+
1881+
it('addField permission not required for adding a nested property', async () => {
1882+
const obj = new Parse.Object('test_7371');
1883+
obj.set('a', {});
1884+
await obj.save();
1885+
obj.set('a.b', 2);
1886+
await obj.save();
1887+
});
1888+
it('addField permission not required for modifying a nested property', async () => {
1889+
const obj = new Parse.Object('test_7371');
1890+
obj.set('a', { b: 1 });
1891+
await obj.save();
1892+
obj.set('a.b', 2);
1893+
await obj.save();
1894+
});
1895+
});
1896+
18691897
it('should aceept class-level permission with userid of any length', async done => {
18701898
await global.reconfigureServer({
18711899
customIdSize: 11,

src/Controllers/DatabaseController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ class DatabaseController {
894894
if (object[field] && object[field].__op && object[field].__op === 'Delete') {
895895
return false;
896896
}
897-
return schemaFields.indexOf(field) < 0;
897+
return schemaFields.indexOf(getRootFieldName(field)) < 0;
898898
});
899899
if (newKeys.length > 0) {
900900
// adds a marker that new field is being adding during update

0 commit comments

Comments
 (0)