feat(operator): show per-tenant role in tenant users list

GET /tenants/:slug/users now returns a tenant-scoped `tenantRole`
(resolved server-side via roleForTenant), and the operator tenant page
displays it instead of the global `role` — so a user who is admin here
but member elsewhere reads correctly in this tenant's context. The
global `role` field is kept intact for other consumers.
This commit is contained in:
Ronni Baslund
2026-05-31 21:31:51 +02:00
parent f094158334
commit 2a43a7bbf3
3 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -203,7 +203,7 @@ async function reconcile() {
</td>
<td>
<Badge :tone="u.platformAdmin ? 'accent' : 'neutral'">
{{ u.platformAdmin ? 'platform-admin' : u.role }}
{{ u.platformAdmin ? 'platform-admin' : u.tenantRole }}
</Badge>
</td>
<td>
+5
View File
@@ -41,7 +41,12 @@ export interface TenantUser {
authentikSubjectId: string
email: string
name: string
// Global/legacy role + fallback. Prefer `tenantRole` for display in a tenant
// context — `role` can differ from the user's actual role in this tenant.
role: 'owner' | 'admin' | 'member'
// Role resolved for THIS tenant (per-tenant override, else global `role`).
// Set by GET /tenants/:slug/users.
tenantRole: 'owner' | 'admin' | 'member'
active: boolean
platformAdmin: boolean
tenantIds: string[]