diff --git a/components/user/dropdown.tsx b/components/user/dropdown.tsx index 6817681..8e8a7df 100644 --- a/components/user/dropdown.tsx +++ b/components/user/dropdown.tsx @@ -91,7 +91,7 @@ export function UserDropdown() {
- {(userInfo as { account_name?: string })?.account_name ?? (isAdmin ? "rustfsAdmin" : "")} + {(userInfo as { account_name?: string })?.account_name ?? ""}
{!isAdmin && ( diff --git a/hooks/use-permissions.tsx b/hooks/use-permissions.tsx index d0b7203..02f4000 100644 --- a/hooks/use-permissions.tsx +++ b/hooks/use-permissions.tsx @@ -126,10 +126,10 @@ export function PermissionsProvider({ children }: { children: React.ReactNode }) }, [api, isAuthenticated, hasResolvedAdmin, fetchAdminStatus]) useEffect(() => { - if (api && isAuthenticated && hasResolvedAdmin && !isAdmin && !hasFetchedPolicy && !isLoading) { + if (api && isAuthenticated && hasResolvedAdmin && !hasFetchedPolicy && !isLoading) { fetchUserPolicy() } - }, [api, isAuthenticated, hasResolvedAdmin, isAdmin, hasFetchedPolicy, isLoading, fetchUserPolicy]) + }, [api, isAuthenticated, hasResolvedAdmin, hasFetchedPolicy, isLoading, fetchUserPolicy]) const canChangePassword = isAdmin || hasPermission(CONSOLE_SCOPES.CONSOLE_ADMIN)