MCPcopy
hub / github.com/parse-community/parse-server / setPermissionsOnClass

Function setPermissionsOnClass

spec/ParseLiveQueryServer.spec.js:157–175  ·  view source on GitHub ↗
(className, permissions, doPut)

Source from the content-addressed store, hash-verified

155
156 it('properly passes the CLP to afterSave/afterDelete hook', function (done) {
157 async function setPermissionsOnClass(className, permissions, doPut) {
158 const method = doPut ? 'PUT' : 'POST';
159 const response = await fetch(Parse.serverURL + '/schemas/' + className, {
160 method,
161 headers: {
162 'X-Parse-Application-Id': Parse.applicationId,
163 'X-Parse-Master-Key': Parse.masterKey,
164 'Content-Type': 'application/json',
165 },
166 body: JSON.stringify({
167 classLevelPermissions: permissions,
168 }),
169 });
170 const body = await response.json();
171 if (body.error) {
172 throw body;
173 }
174 return body;
175 }
176
177 let saveSpy;
178 let deleteSpy;

Callers 1

Calls 1

fetchFunction · 0.70

Tested by

no test coverage detected