Do not allow to protect default fields (#6439)
* consider default columns * disallow protecting default fields
This commit is contained in:
@@ -307,6 +307,13 @@ function validateCLP(
|
||||
|
||||
// if the field is in form of array
|
||||
for (const field of protectedFields) {
|
||||
// do not alloow to protect default fields
|
||||
if (defaultColumns._Default[field]) {
|
||||
throw new Parse.Error(
|
||||
Parse.Error.INVALID_JSON,
|
||||
`Default field '${field}' can not be protected`
|
||||
);
|
||||
}
|
||||
// field should exist on collection
|
||||
if (!Object.prototype.hasOwnProperty.call(fields, field)) {
|
||||
throw new Parse.Error(
|
||||
|
||||
Reference in New Issue
Block a user