MCPcopy Create free account
hub / github.com/parse-community/parse-server / validateCLPjson

Function validateCLPjson

src/Controllers/SchemaController.js:401–420  ·  view source on GitHub ↗
(operation: any, operationKey: string)

Source from the content-addressed store, hash-verified

399}
400
401function validateCLPjson(operation: any, operationKey: string) {
402 if (operationKey === 'readUserFields' || operationKey === 'writeUserFields') {
403 if (!Array.isArray(operation)) {
404 throw new Parse.Error(
405 Parse.Error.INVALID_JSON,
406 `'${operation}' is not a valid value for class level permissions ${operationKey} - must be an array`
407 );
408 }
409 } else {
410 if (typeof operation === 'object' && operation !== null) {
411 // ok to proceed
412 return;
413 } else {
414 throw new Parse.Error(
415 Parse.Error.INVALID_JSON,
416 `'${operation}' is not a valid value for class level permissions ${operationKey} - must be an object`
417 );
418 }
419 }
420}
421
422function validatePointerPermission(fieldName: string, fields: Object, operation: string) {
423 // Uses collection schema to ensure the field is of type:

Callers 1

validateCLPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…