1
0
forked from baron/baron-sso

fix: ensure all manageable tenants are visible for tenant admin and refine overview UI

This commit is contained in:
2026-03-04 14:04:18 +09:00
parent 145b807ebf
commit 9da97554ce
3 changed files with 94 additions and 95 deletions

View File

@@ -4046,6 +4046,14 @@ func (h *AuthHandler) resolveCurrentProfile(c *fiber.Ctx) (*domain.UserProfileRe
}
}
// [New] Fetch manageable tenants for Tenant Admin
if profile.Role == domain.RoleTenantAdmin && h.TenantService != nil {
manageable, err := h.TenantService.ListManageableTenants(c.Context(), profile.ID)
if err == nil {
profile.ManageableTenants = manageable
}
}
// 4. Save to Redis Cache (Short TTL)
// IMPORTANT: In dev mode, if role was overridden, we should NOT cache it under the token key
// or we should include the mock role in the cache key.