|
15 | 15 | * 'member'` in both `MembersPage` and `InviteMemberDialog`, so a role the |
16 | 16 | * server had learned about was still unreachable from either screen. |
17 | 17 | * |
18 | | - * ⚠️ This list MIRRORS the server; it does not derive from it. `/auth/config` |
19 | | - * exposes feature flags but no role vocabulary, so there is no surface to read |
20 | | - * — see objectstack-ai/objectstack#3723, which tracks making one list the |
21 | | - * source for all of them (the framework already carries the same list twice: |
22 | | - * the better-auth roles map and two enforced `Field.select` option sets). Until |
23 | | - * that lands, a role added server-side must be added HERE too — one place, not |
24 | | - * two. |
| 18 | + * ## The vocabulary is CLOSED — this mirror is complete by construction |
| 19 | + * |
| 20 | + * [framework ADR-0108 / objectstack#3723] These four names are the WHOLE list, |
| 21 | + * and the framework owns them. An application cannot add a fifth: the server |
| 22 | + * used to register every declared `position` / `permission` name as an |
| 23 | + * organization role, and that was retired, because every value stored in |
| 24 | + * `sys_member.role` is projected into `current_user.positions` — so a business |
| 25 | + * role handed out this way was capability with none of the position system's |
| 26 | + * controls (no `granted_by`, no validity window, no scope check). |
| 27 | + * |
| 28 | + * So the standing instruction that used to live here — *"a role added |
| 29 | + * server-side must be added HERE too"* — no longer applies. There are no |
| 30 | + * server-side additions to chase. A membership role is an organization GRADE |
| 31 | + * (what you may reach); what a person may DO is a position, granted through |
| 32 | + * `sys_user_position` or an invitation's placement (framework ADR-0105 D8). |
| 33 | + * |
| 34 | + * ⚠️ Still a mirror, not a derivation — but now only for a packaging reason, |
| 35 | + * not a design one. The names live in `@objectstack/spec` as |
| 36 | + * `BUILTIN_MEMBERSHIP_ROLES` / `BUILTIN_MEMBERSHIP_ROLE_OPTIONS`, which |
| 37 | + * `@object-ui/auth` cannot import yet: this package does not depend on |
| 38 | + * `@objectstack/spec`, and the constants ship in the first release carrying |
| 39 | + * ADR-0108 (absent from the published 16.1.0). Once this package takes that |
| 40 | + * dependency at a version that has them, the four `export const`s below become |
| 41 | + * a re-export and `ORG_ROLES` becomes `[...BUILTIN_MEMBERSHIP_ROLES]` — the |
| 42 | + * labels and grade ladder stay here, since they are console concerns. |
| 43 | + * `orgRolesMatchFramework` in the tests pins the list until then. |
25 | 44 | */ |
26 | 45 |
|
27 | 46 | export const ORG_ROLE_OWNER = 'owner'; |
|
0 commit comments