diff --git a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx index 82ab49161..4109c6a5d 100644 --- a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx +++ b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx @@ -52,6 +52,7 @@ export function AccessControlPanel({ {!isEditDisabled && !isEditMode && ( diff --git a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx index 3201959cc..503493356 100644 --- a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx +++ b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx @@ -24,11 +24,13 @@ import { ResourceControlViewModel } from '../models/ResourceControlViewModel'; interface Props { resourceControl?: ResourceControlViewModel; resourceType: ResourceControlType; + isAuthorisedToFetchUsers?: boolean; } export function AccessControlPanelDetails({ resourceControl, resourceType, + isAuthorisedToFetchUsers = false, }: Props) { const inheritanceMessage = getInheritanceMessage( resourceType, @@ -41,7 +43,10 @@ export function AccessControlPanelDetails({ TeamAccesses: restrictedToTeams = [], } = resourceControl || {}; - const users = useAuthorizedUsers(restrictedToUsers.map((ra) => ra.UserId)); + const users = useAuthorizedUsers( + restrictedToUsers.map((ra) => ra.UserId), + isAuthorisedToFetchUsers + ); const teams = useAuthorizedTeams(restrictedToTeams.map((ra) => ra.TeamId)); const teamsLength = teams.data ? teams.data.length : 0;