fix: adding or modifying a nested property requires addField permissions (#7679)
This commit is contained in:
@@ -1779,6 +1779,34 @@ describe('schemas', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Nested documents', () => {
|
||||
beforeAll(async () => {
|
||||
const testSchema = new Parse.Schema('test_7371');
|
||||
testSchema.setCLP({
|
||||
create: { ['*']: true },
|
||||
update: { ['*']: true },
|
||||
addField: {},
|
||||
});
|
||||
testSchema.addObject('a');
|
||||
await testSchema.save();
|
||||
});
|
||||
|
||||
it('addField permission not required for adding a nested property', async () => {
|
||||
const obj = new Parse.Object('test_7371');
|
||||
obj.set('a', {});
|
||||
await obj.save();
|
||||
obj.set('a.b', 2);
|
||||
await obj.save();
|
||||
});
|
||||
it('addField permission not required for modifying a nested property', async () => {
|
||||
const obj = new Parse.Object('test_7371');
|
||||
obj.set('a', { b: 1 });
|
||||
await obj.save();
|
||||
obj.set('a.b', 2);
|
||||
await obj.save();
|
||||
});
|
||||
});
|
||||
|
||||
it('should aceept class-level permission with userid of any length', async done => {
|
||||
await global.reconfigureServer({
|
||||
customIdSize: 11,
|
||||
|
||||
Reference in New Issue
Block a user