mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
RolePicker: Don't try to fetch roles for new form (#84630)
This commit is contained in:
parent
fce78aea2c
commit
8714b7cd8c
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user