fix: ensure all manageable tenants are visible for tenant admin and refine overview UI
This commit is contained in:
1 parent
145b807ebf
commit
9da97554ce
3 files changed
+94
-95
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user