Skip to content

Commit

Permalink
Allow reset of user password without roles
Browse files Browse the repository at this point in the history
  • Loading branch information
samgibsonmoj committed Aug 20, 2024
1 parent 1283814 commit 3f4485d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Server.UI/Pages/Identity/Users/Users.razor
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@
_initialised = true;
}

private bool CanResetPassword(string[] roles)
private bool CanResetPassword(string[] affectedUserRoles)
{
var userRole = _roles.Where(role => roles.Contains(role.Name)).MinBy(role => role.RoleRank);
var userRole = _roles.Where(role => affectedUserRoles.Contains(role.Name)).MinBy(role => role.RoleRank);
var currentUserRole = _roles.Where(role => CurrentRoles.Contains(role.Name)).MinBy(role => role.RoleRank);
return _canResetPassword && currentUserRole?.RoleRank <= userRole?.RoleRank;
}
Expand Down

0 comments on commit 3f4485d

Please sign in to comment.