1
0
forked from baron/baron-sso

fix: additional UI cleanup for RBAC simplification

- Simplified access control in TenantListPage and UserDetailPage.
- Final formatting and default tab fixes in TenantWorksmobilePage.
This commit is contained in:
2026-06-02 19:24:05 +09:00
parent 74068503bb
commit e5f1c85e29
3 changed files with 10 additions and 23 deletions

View File

@@ -294,19 +294,6 @@ function TenantListPage() {
});
const profileRole = normalizeAdminRole(profile?.role);
// Redirect tenant_admin ONLY if they have one or fewer manageable tenants in the list
React.useEffect(() => {
if (profile && profileRole === "tenant_admin") {
const manageableCount = profile.manageableTenants?.length ?? 0;
if (
(manageableCount === 1 || manageableCount === 0) &&
profile.tenantId
) {
navigate(`/tenants/${profile.tenantId}`, { replace: true });
}
}
}, [profile, profileRole, navigate]);
const query = useInfiniteQuery({
queryKey: ["tenants", "lazy"],
queryFn: ({ pageParam }) =>
@@ -319,10 +306,7 @@ function TenantListPage() {
initialPageParam: "",
getNextPageParam: (lastPage) =>
lastPage.nextCursor || lastPage.next_cursor || undefined,
enabled:
profileRole === "super_admin" ||
(profileRole === "tenant_admin" &&
(profile?.manageableTenants?.length ?? 0) > 1),
enabled: profileRole === "super_admin",
});
const deleteBulkMutation = useMutation({