@openinc/parse-server-opendash 4.4.4 → 4.4.6

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.
@@ -36,7 +36,6 @@ export declare namespace Permissions {
36
36
  }
37
37
  enum CORE {
38
38
  adminoverview = "opendash:can-access-admin-overview",
39
- mailadmin = "parse-admin:can-access-mail-admin",
40
39
  rmqadmin = "parse-admin:can-access-rmq-admin",
41
40
  metaadmin = "meta:can-see-admin",
42
41
  chatadmin = "chat:can-see-admin",
@@ -62,7 +62,7 @@ var Permissions;
62
62
  (function (CORE) {
63
63
  // Access
64
64
  CORE["adminoverview"] = "opendash:can-access-admin-overview";
65
- CORE["mailadmin"] = "parse-admin:can-access-mail-admin";
65
+ //mailadmin = "parse-admin:can-access-mail-admin",
66
66
  CORE["rmqadmin"] = "parse-admin:can-access-rmq-admin";
67
67
  // Admin areas of the CORE-owned plugins. The owning classes are mapped to
68
68
  // CORE in featuremap.json (OD3_Meta_*, OD3_Chat_Message, OD3_Changelog),
@@ -13,7 +13,21 @@ const index_js_2 = require("../types/index.js");
13
13
  async function init() {
14
14
  (0, index_js_1.beforeSaveHook)(index_js_2.Chat_Message, async (request) => {
15
15
  await (0, index_js_1.defaultHandler)(request);
16
- await (0, index_js_1.defaultAclHandler)(request);
16
+ // `allowTenantUserWrite` because reacting is an update on *someone else's*
17
+ // message (see `useToggleReaction` in the chat plugin) — without it only
18
+ // tenant admins could react. Who may edit or delete what is enforced in the
19
+ // UI (`isOwn`); the ACL only has to let the write through.
20
+ await (0, index_js_1.defaultAclHandler)(request, { allowTenantUserWrite: true });
21
+ // Chat_Message carries `author`, not `user`, so `defaultAclHandler` — which
22
+ // looks for a `user` field — never grants the owner write access. Grant it
23
+ // explicitly, so an author can always edit and soft-delete their own
24
+ // message, independent of their tenant roles. This mirrors the ACL the v1
25
+ // migration already writes for chat messages (see
26
+ // `scripts/migration/passes/10-chat.ts`).
27
+ const author = request.object.get("author");
28
+ if (author?.id) {
29
+ request.object.getACL()?.setWriteAccess(author.id, true);
30
+ }
17
31
  });
18
32
  (0, index_js_1.afterSaveHook)(index_js_2.Chat_Message, async ({ object, original }) => {
19
33
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "4.4.4",
3
+ "version": "4.4.6",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@11.25.0",
6
6
  "keywords": [