Commit 727d74c
committed
RBAC: Teams page UI — role dropdowns, plan-aware disabling, manage gating (TRI-8748)
Wire RBAC into the existing org Teams page (settings/team).
OSS plugin
- Adds RoleBaseAccessController.getAssignableRoleIds(orgId) — the
subset of allRoles(orgId) that can be assigned right now. Returns
[] in the OSS fallback (consistent with allRoles also returning []
there). Pure UI affordance: server-side enforcement remains
setUserRole's lookupAssignableRole. Public package change with
patch-level changeset.
Enterprise plugin
- Implements getAssignableRoleIds against PlansClient: system roles
pass through isSystemRoleAssignable (Owner/Admin always; Member /
Viewer require Pro+); custom roles require canCreateCustomRoles
(Enterprise tier). Mirrors the gates in setUserRole so UI and
server agree.
Webapp
- TeamPresenter now also returns rbac.allRoles(orgId),
getAssignableRoleIds(orgId), and per-member role assignments.
Per-member is N+1 today (low-traffic settings page); a batched
lookup is filed as a future optimisation.
- Route migrated from requireUserId to dashboardLoader / dashboardAction
via the split builder (commit a2cdbfb). Loader gates on
read:members; action stays permissive at the wrapper level so the
existing remove/leave + purchase-seats flows keep working with
their per-intent checks. New set-role intent gates on
manage:members and calls rbac.setUserRole — surfaces the Result
error inline next to the dropdown when the server rejects (system
role rename, plan-gated assignment, foreign-org role).
- UI: native select next to each member, defaults to that member's
current role. Options not in assignableRoleIds render disabled
with an (upgrade) suffix. Auto-submits on change via fetcher.
Invite + Remove buttons hide/disable when canManageMembers is
false (server-side ability check pre-computed in the loader).
Self-leave is always allowed regardless of manage:members.
Verification
- Typecheck clean across @internal/rbac, webapp, enterprise/plugins,
enterprise/db, packages/plans.
- Browser smoke test deferred until webapp dev server is running.1 parent 4d76bd5 commit 727d74c
6 files changed
Lines changed: 328 additions & 85 deletions
File tree
- .changeset
- apps/webapp/app
- presenters
- routes/_app.orgs.$organizationSlug.settings.team
- internal-packages/rbac/src
- packages/plugins/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
21 | 44 | | |
22 | 45 | | |
23 | 46 | | |
| |||
38 | 61 | | |
39 | 62 | | |
40 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
41 | 67 | | |
42 | 68 | | |
43 | 69 | | |
0 commit comments