RBAC: Render team, service account and user list when a user can see entities but not roles attached to them (#79642)

* Render list even when user cannot list roles assigned for entities
This commit is contained in:
Karl Persson
2023-12-18 15:55:02 +01:00
committed by GitHub
parent f7248efff5
commit 0437a74956
3 changed files with 13 additions and 4 deletions

View File

@@ -41,7 +41,10 @@ export function loadTeams(initial = false): ThunkResult<void> {
noTeams = response.teams.length === 0;
}
if (contextSrv.licensedAccessControlEnabled()) {
if (
contextSrv.licensedAccessControlEnabled() &&
contextSrv.hasPermission(AccessControlAction.ActionTeamsRolesList)
) {
dispatch(rolesFetchBegin());
const teamIds = response?.teams.map((t: Team) => t.id);
const roles = await getBackendSrv().post(`/api/access-control/teams/roles/search`, { teamIds });