@openinc/parse-server-opendash 3.14.2 → 3.14.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.
package/README.md CHANGED
@@ -29,3 +29,5 @@ For a full list of options see the file at [CONFIG.md](https://github.com/open-i
29
29
  ## Development
30
30
 
31
31
  See the file at [DEVELOPMENT.md](https://github.com/open-inc/node-parse-server-opendash/blob/master/DEVELOPMENT.md)
32
+
33
+ ##
@@ -3,9 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.init = init;
4
4
  const __1 = require("..");
5
5
  const types_1 = require("../types");
6
+ const masterKeyPermission = [
7
+ "opendash:can-admin-tenants",
8
+ "opendash:tenant:change-tag-prefix",
9
+ "opendash:source:write-tag-ignore-tenant-prefix",
10
+ "opendash:source:write-tag-group",
11
+ ];
6
12
  async function init() {
7
13
  (0, __1.beforeSaveHook)(types_1.Permission, async (request) => {
8
14
  const { object, original, user } = request;
15
+ if (masterKeyPermission.includes(object.get("key")) && !request.master) {
16
+ throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, `User is not allowed to create or update permission with key '${object.get("key")}' without master key`);
17
+ }
9
18
  await (0, __1.defaultHandler)(request);
10
19
  await (0, __1.defaultAclHandler)(request, {
11
20
  allowCustomACL: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "3.14.2",
3
+ "version": "3.14.4",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "keywords": [