diff --git a/public/app/core/components/RolePicker/api.ts b/public/app/core/components/RolePicker/api.ts index 596463b4a9d..027cc48c8c5 100644 --- a/public/app/core/components/RolePicker/api.ts +++ b/public/app/core/components/RolePicker/api.ts @@ -16,7 +16,7 @@ export const fetchRoleOptions = async (orgId?: number): Promise => { }; export const fetchUserRoles = async (userId: number, orgId?: number): Promise => { - let userRolesUrl = `/api/access-control/users/${userId}/roles?includeMapped=true`; + let userRolesUrl = `/api/access-control/users/${userId}/roles?includeMapped=true&includeHidden=true`; if (orgId) { userRolesUrl += `&targetOrgId=${orgId}`; } diff --git a/public/app/features/serviceaccounts/state/actions.ts b/public/app/features/serviceaccounts/state/actions.ts index 5e75bc5378f..35e404e75e1 100644 --- a/public/app/features/serviceaccounts/state/actions.ts +++ b/public/app/features/serviceaccounts/state/actions.ts @@ -63,7 +63,10 @@ export function fetchServiceAccounts( dispatch(rolesFetchBegin()); const orgId = contextSrv.user.orgId; const userIds = result?.serviceAccounts.map((u: ServiceAccountDTO) => u.id); - const roles = await getBackendSrv().post(`/api/access-control/users/roles/search`, { userIds, orgId }); + const roles = await getBackendSrv().post(`/api/access-control/users/roles/search?includeHidden=true`, { + userIds, + orgId, + }); result.serviceAccounts.forEach((u: ServiceAccountDTO) => { u.roles = roles ? roles[u.id] || [] : []; });