@7365admin1/core 3.46.1-staging.112 → 3.46.1-staging.113
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/staff-console-authorization.md +29 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4735 -4691
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1281 -1233
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/staff-console-authz.test.mjs +248 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Staff console authorization: subscriptions, plans, promo codes, client status and platform Terms now require a Seven365 staff membership
|
|
6
|
+
|
|
7
|
+
The organisation, subscription, subscription-plan, promo-code and platform-terms
|
|
8
|
+
controllers checked only that a session existed, so every write behind the
|
|
9
|
+
Seven365 staff console was reachable by any signed-in account on the platform.
|
|
10
|
+
|
|
11
|
+
- `requirePlatformStaff` (new `src/utils/console-authz.util.ts`) gates the writes
|
|
12
|
+
that are ours to make: creating an organisation, suspending or reactivating a
|
|
13
|
+
client, the plan catalogue, minting a promo code, and publishing platform-wide
|
|
14
|
+
Terms. It reuses `isSuperAdmin` — a `members` row of type "admin" whose role is
|
|
15
|
+
also of type "admin" — the same check SP Approvals, Marketplace Vendors and the
|
|
16
|
+
notification broadcast already use. No role-name string takes part.
|
|
17
|
+
- `requireOrgAccess` gates the two writes a client legitimately makes on their
|
|
18
|
+
own account — editing their organisation during onboarding, and changing the
|
|
19
|
+
seat count on their own subscription. The organisation is read off the stored
|
|
20
|
+
subscription, never off the request.
|
|
21
|
+
- `POST /terms` took `createdBy` from the request body; it is now the session, so
|
|
22
|
+
published Terms can no longer be attributed to somebody else. The `user` field
|
|
23
|
+
is still accepted and ignored, so no application has to be released in step.
|
|
24
|
+
- The two `organizations/v2` reads page over every organisation on the platform
|
|
25
|
+
with its subscription and billing data; they are gated to staff for the same
|
|
26
|
+
reason.
|
|
27
|
+
|
|
28
|
+
The paid signup checkout and self-signup organisation creation are deliberately
|
|
29
|
+
left open — they are customer paths, and a test pins them that way.
|
package/dist/index.d.ts
CHANGED
|
@@ -697,6 +697,12 @@ declare function useOrgController(): {
|
|
|
697
697
|
|
|
698
698
|
/**
|
|
699
699
|
* V2 organization HTTP surface — new handlers; v1 `useOrgController` remains unchanged.
|
|
700
|
+
*
|
|
701
|
+
* Both handlers page over EVERY organisation on the platform, and
|
|
702
|
+
* `getOrganizationsWithSubscription` joins each one to its subscription — plan,
|
|
703
|
+
* seats, billing cycle, next billing date. That is one tenant's commercial data
|
|
704
|
+
* readable by another tenant's staff, so these two reads are gated even though
|
|
705
|
+
* they are reads. The only consumer is the staff Client List.
|
|
700
706
|
*/
|
|
701
707
|
declare function useOrgControllerV2(): {
|
|
702
708
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|