diff --git a/public/app/core/components/RolePicker/TeamRolePicker.tsx b/public/app/core/components/RolePicker/TeamRolePicker.tsx index c380a120944..f4f33871a53 100644 --- a/public/app/core/components/RolePicker/TeamRolePicker.tsx +++ b/public/app/core/components/RolePicker/TeamRolePicker.tsx @@ -53,7 +53,7 @@ export const TeamRolePicker = ({ return pendingRoles; } - if (contextSrv.hasPermission(AccessControlAction.ActionTeamsRolesList)) { + if (contextSrv.hasPermission(AccessControlAction.ActionTeamsRolesList) && teamId > 0) { return await fetchTeamRoles(teamId); } } catch (e) { diff --git a/public/app/core/components/RolePicker/UserRolePicker.tsx b/public/app/core/components/RolePicker/UserRolePicker.tsx index 56834457191..1b3bab63b71 100644 --- a/public/app/core/components/RolePicker/UserRolePicker.tsx +++ b/public/app/core/components/RolePicker/UserRolePicker.tsx @@ -62,7 +62,7 @@ export const UserRolePicker = ({ return pendingRoles; } - if (contextSrv.hasPermission(AccessControlAction.ActionUserRolesList)) { + if (contextSrv.hasPermission(AccessControlAction.ActionUserRolesList) && userId > 0) { return await fetchUserRoles(userId, orgId); } } catch (e) {