@openinc/parse-server-opendash 4.31.3 → 4.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,29 +31,9 @@ const index_js_1 = require("../types/index.js");
|
|
|
31
31
|
*/
|
|
32
32
|
async function init(name) {
|
|
33
33
|
node_1.default.Cloud.define(name, async function (request) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
throw new node_1.default.Error(node_1.default.Error.INVALID_JSON, "No object was passed. Run this from the data browser on a selected row.");
|
|
39
|
-
}
|
|
40
|
-
if (object.className !== index_js_1.Meta_Entry.className) {
|
|
41
|
-
throw new node_1.default.Error(node_1.default.Error.INVALID_CLASS_NAME, `Expected a ${index_js_1.Meta_Entry.className} row, got ${object.className}.`);
|
|
42
|
-
}
|
|
43
|
-
await object.save(null, { useMasterKey: true });
|
|
44
|
-
const acl = object.getACL();
|
|
45
|
-
const subjectId = object.get("entryObjectId");
|
|
46
|
-
return {
|
|
47
|
-
success: true,
|
|
48
|
-
id: object.id,
|
|
49
|
-
context: object.get("context"),
|
|
50
|
-
entryClassName: object.get("entryClassName"),
|
|
51
|
-
// Reported back so the dashboard shows whether the grant actually
|
|
52
|
-
// landed, rather than just "done".
|
|
53
|
-
subjectCanWrite: !!subjectId && !!acl?.getWriteAccess(subjectId),
|
|
54
|
-
};
|
|
55
|
-
}, {
|
|
56
|
-
// Parse Dashboard runs scripts with the master key.
|
|
57
|
-
requireMaster: true,
|
|
34
|
+
const metaEntries = await new node_1.default.Query(index_js_1.Meta_Entry).findAll({
|
|
35
|
+
useMasterKey: true,
|
|
36
|
+
});
|
|
37
|
+
return await index_js_1.Meta_Entry.saveAll(metaEntries, { useMasterKey: true });
|
|
58
38
|
});
|
|
59
39
|
}
|