@hanzo/rooms 0.1.72 → 0.1.73

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.
@@ -180,16 +180,11 @@ export declare const PICKED = "hanzo:org:picked";
180
180
  * app's account menu — is one the gate does not ask for again.
181
181
  */
182
182
  export declare function pick(o: string): void;
183
- /** The reserved org whose own people are the platform's operators. */
184
- export declare const ADMIN_ORG = "admin";
185
- /**
186
- * Whether the signed-in person is a SUPERADMIN, as IAM signs it: the org of the
187
- * person's own row — the first entry of the token's `orgs`, which IAM always puts
188
- * first (hanzoai/iam internal/store/membership.go `MemberOrgRefs`) — is the
189
- * reserved `admin` org. It is the equality IAM decides `assume` and the
190
- * organization list on (pkg/schema/user.go `SuperAdmin`) and cloud's `Super`.
191
- * Not the `owner` claim: a sign-in token carries the APPLICATION's org there. A
192
- * membership of `admin` is not it either, and neither is being an org's admin.
183
+ /**
184
+ * Whether the signed-in person is a SUPERADMIN: @hanzo/iam's `superAdmin`, which is
185
+ * hanzoai/authz `Claims.Sudo` exactly — a person (never a program) whose own row's
186
+ * org, the first entry of the token's `orgs`, is the reserved `admin` org, compared
187
+ * verbatim. Not the `owner` claim, not a membership of `admin`, not an org's admin.
193
188
  * It decides only what is drawn: IAM refuses everyone else the list of every
194
189
  * organization and the step into one.
195
190
  */
@@ -14,6 +14,7 @@
14
14
  * who was signed in, which reads as a permissions problem rather than a typo.
15
15
  * Two derivations of one name never agree; this is the one derivation.
16
16
  */
17
+ import { superAdmin as sudo } from '@hanzo/iam/browser';
17
18
  import { api } from './api.js';
18
19
  import { where } from '../where.js';
19
20
  /** The SDK's own keys, `hanzo_iam_`-prefixed. The far side of a boundary. */
@@ -436,21 +437,16 @@ export function pick(o) {
436
437
  }
437
438
  window.dispatchEvent(new Event(ORG));
438
439
  }
439
- /** The reserved org whose own people are the platform's operators. */
440
- export const ADMIN_ORG = 'admin';
441
440
  /**
442
- * Whether the signed-in person is a SUPERADMIN, as IAM signs it: the org of the
443
- * person's own row — the first entry of the token's `orgs`, which IAM always puts
444
- * first (hanzoai/iam internal/store/membership.go `MemberOrgRefs`) — is the
445
- * reserved `admin` org. It is the equality IAM decides `assume` and the
446
- * organization list on (pkg/schema/user.go `SuperAdmin`) and cloud's `Super`.
447
- * Not the `owner` claim: a sign-in token carries the APPLICATION's org there. A
448
- * membership of `admin` is not it either, and neither is being an org's admin.
441
+ * Whether the signed-in person is a SUPERADMIN: @hanzo/iam's `superAdmin`, which is
442
+ * hanzoai/authz `Claims.Sudo` exactly — a person (never a program) whose own row's
443
+ * org, the first entry of the token's `orgs`, is the reserved `admin` org, compared
444
+ * verbatim. Not the `owner` claim, not a membership of `admin`, not an org's admin.
449
445
  * It decides only what is drawn: IAM refuses everyone else the list of every
450
446
  * organization and the step into one.
451
447
  */
452
448
  export function superAdmin() {
453
- return home() === ADMIN_ORG;
449
+ return sudo(claims());
454
450
  }
455
451
  /** The organization a SuperAdmin stepped into through IAM, from the token's `assumed` claim, or null. */
456
452
  export function assumed() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/rooms",
3
- "version": "0.1.72",
3
+ "version": "0.1.73",
4
4
  "description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -53,7 +53,7 @@
53
53
  "@hanzo/composer": ">=0.2.0",
54
54
  "@hanzo/event": ">=0.3.56",
55
55
  "@hanzo/gui": "^8.3.5",
56
- "@hanzo/iam": ">=0.21.28",
56
+ "@hanzo/iam": ">=0.21.33",
57
57
  "@hanzo/logo": ">=1.0.26",
58
58
  "@hanzo/studio": ">=0.1.0",
59
59
  "@hanzo/ui": ">=8.27.67",
@@ -72,7 +72,7 @@
72
72
  "@hanzo/design": "0.5.34",
73
73
  "@hanzo/event": "0.3.56",
74
74
  "@hanzo/gui": "8.3.5",
75
- "@hanzo/iam": "0.21.28",
75
+ "@hanzo/iam": "0.21.33",
76
76
  "@hanzo/logo": "1.0.26",
77
77
  "@hanzo/studio": "0.1.0",
78
78
  "@hanzo/ui": "8.27.67",