RolePicker: Don't try to fetch roles for new form (#84630)

This commit is contained in:
Karl Persson 2024-03-18 11:15:49 +01:00 committed by GitHub
parent fce78aea2c
commit 8714b7cd8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

@ -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) {