@7365admin1/core 3.64.5-staging.297 → 3.64.5-staging.298
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/.changeset/module-gate-server.md +35 -0
- package/dist/index.d.ts +1000 -675
- package/dist/index.js +7831 -7069
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5941 -5189
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/test/console-permission.test.mjs +4 -3
- package/test/module-access.test.mjs +128 -0
- package/test/module-gate.fixtures.mjs +108 -0
- package/test/module-gate.test.mjs +64 -0
- package/test/modules-endpoint.test.mjs +525 -0
- package/test/notification-access.test.mjs +197 -0
- package/test/staff-console-authz.test.mjs +9 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Module gate, server step: the deny-list endpoint, the impact preview, and
|
|
6
|
+
acknowledge-before-save. Everything ships inert and fails open.
|
|
7
|
+
|
|
8
|
+
- `useMemberController().getModulesByUserIdType` (for
|
|
9
|
+
`GET /api/members/user/:id/app/:type/modules?org=&site=`) answers
|
|
10
|
+
`{ denied: string[] }` for the membership `getByUserIdType` answers with. It
|
|
11
|
+
is the same self-or-staff guard. It answers `[]` for no list, an empty list,
|
|
12
|
+
a resident, Seven365 staff, a site of another organisation, any lookup
|
|
13
|
+
error, and `MODULE_LIST_GATE=off`. `ALWAYS_ALLOWED` is never denied.
|
|
14
|
+
- A saved list is enforced only once it has been saved through the
|
|
15
|
+
acknowledged preview. The marker is the save's own append-only console-audit
|
|
16
|
+
row (`gateListHash`). A list saved earlier, or changed any other way, behaves
|
|
17
|
+
as absent. No field is added to any organisation or site.
|
|
18
|
+
- `useOrgController().previewOrgModules` and
|
|
19
|
+
`useSiteController().previewSiteModules` (for
|
|
20
|
+
`POST /api/organizations/:id/modules/preview` and
|
|
21
|
+
`POST /api/sites/:id/modules/preview`) return who would lose what. They are
|
|
22
|
+
read-only and never go through `GET /api/roles`.
|
|
23
|
+
- `updateModules` and `updateSiteModules` accept `acknowledgeImpact`. A save
|
|
24
|
+
that takes a module away from somebody is refused with 409 until it is
|
|
25
|
+
acknowledged. An empty list restores everything and never needs it. Site
|
|
26
|
+
saves are now recorded in the console audit (`site.modules-changed`).
|
|
27
|
+
- `filterByAccess` (Q7) runs at the top of the notification `send()`. It is
|
|
28
|
+
`NOTIFY_ACCESS_FILTER=log` by default: it logs who would be filtered and
|
|
29
|
+
still sends to everyone. It is exported so API-core's own sender can call it.
|
|
30
|
+
- `moduleDeniedForCaller` (Q3) is the server-refusal primitive. It is
|
|
31
|
+
`MODULE_GATE_MODE=log` by default and never refuses. `enforce` refuses only
|
|
32
|
+
the keys in `MODULE_GATE_ENFORCE_KEYS`. Work stamped (`at`) before the
|
|
33
|
+
acknowledged save is accepted.
|
|
34
|
+
- `MODULE_LIST_GATE` (code default `on`) switches all of the above off at
|
|
35
|
+
once.
|