MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / checkWriteAclAndUpdateVersion

Function checkWriteAclAndUpdateVersion

helpers/custom.js:39–64  ·  view source on GitHub ↗
(appId, documents, accessList, isMasterKey)

Source from the content-addressed store, hash-verified

37 },
38
39 checkWriteAclAndUpdateVersion(appId, documents, accessList, isMasterKey) {
40 const deferred = q.defer();
41
42 try {
43 const promises = [];
44 for (let i = 0; i < documents.length; i++) {
45 promises.push(
46 this.verifyWriteACLAndUpdateVersion(
47 appId, documents[i]._tableName, documents[i], accessList, isMasterKey,
48 ),
49 );
50 }
51 q.all(promises).then((docs) => {
52 deferred.resolve(docs);
53 }, (err) => {
54 deferred.reject(err);
55 });
56 } catch (err) {
57 winston.log('error', {
58 error: String(err),
59 stack: new Error().stack,
60 });
61 deferred.reject('Unauthorized to modify');
62 }
63 return deferred.promise;
64 },
65
66 checkWriteAcl(appId, document, accessList, isMasterKey) {
67 try {

Callers

nothing calls this directly

Calls 1

allMethod · 0.80

Tested by

no test coverage detected