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

Function validatePermissionKey

src/Controllers/SchemaController.js:218–235  ·  view source on GitHub ↗
(key, userIdRegExp)

Source from the content-addressed store, hash-verified

216]);
217
218function validatePermissionKey(key, userIdRegExp) {
219 let matchesSome = false;
220 for (const regEx of clpFieldsRegex) {
221 if (key.match(regEx) !== null) {
222 matchesSome = true;
223 break;
224 }
225 }
226
227 // userId depends on startup options so it's dynamic
228 const valid = matchesSome || key.match(userIdRegExp) !== null;
229 if (!valid) {
230 throw new Parse.Error(
231 Parse.Error.INVALID_JSON,
232 `'${key}' is not a valid key for class level permissions`
233 );
234 }
235}
236
237function validateProtectedFieldsKey(key, userIdRegExp) {
238 let matchesSome = false;

Callers 1

validateCLPFunction · 0.85

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…