MCPcopy Index your code
hub / github.com/parse-community/parse-server / untransformObjectACL

Function untransformObjectACL

src/Controllers/DatabaseController.js:385–406  ·  view source on GitHub ↗
({ _rperm, _wperm, ...output })

Source from the content-addressed store, hash-verified

383};
384// Transforms a Database format ACL to a REST API format ACL
385const untransformObjectACL = ({ _rperm, _wperm, ...output }) => {
386 if (_rperm || _wperm) {
387 output.ACL = {};
388
389 (_rperm || []).forEach(entry => {
390 if (!output.ACL[entry]) {
391 output.ACL[entry] = { read: true };
392 } else {
393 output.ACL[entry]['read'] = true;
394 }
395 });
396
397 (_wperm || []).forEach(entry => {
398 if (!output.ACL[entry]) {
399 output.ACL[entry] = { write: true };
400 } else {
401 output.ACL[entry]['write'] = true;
402 }
403 });
404 }
405 return output;
406};
407
408/**
409 * When querying, the fieldName may be compound, extract the root fieldName

Callers 1

findMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected