(operation: any, operationKey: string)
| 399 | } |
| 400 | |
| 401 | function 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 | |
| 422 | function validatePointerPermission(fieldName: string, fields: Object, operation: string) { |
| 423 | // Uses collection schema to ensure the field is of type: |
no outgoing calls
no test coverage detected
searching dependent graphs…