Skip to content

Commit

Permalink
PM-3275 - CurrentContextExtensions.cs - Refactor AnyOrgUserHasManageR…
Browse files Browse the repository at this point in the history
…esetPasswordPermission per PR feedback to remove unnecessary var.
  • Loading branch information
JaredSnider-Bitwarden committed Oct 13, 2023
1 parent 9b78c53 commit f3bda42
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Core/Context/CurrentContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ public static class CurrentContextExtensions
public static async Task<bool> AnyOrgUserHasManageResetPasswordPermission(this ICurrentContext currentContext,
ICollection<OrganizationUserOrganizationDetails> organizationUserDetails)
{
var hasManageResetPasswordPermission = false;
// if user has a single org with manage reset password permission, then they have it
foreach (var orgUserDetail in organizationUserDetails)
{
if (await currentContext.ManageResetPassword(orgUserDetail.OrganizationId))
{
hasManageResetPasswordPermission = true;
break;
return true;
}
}
return hasManageResetPasswordPermission;
return false;
}
}

0 comments on commit f3bda42

Please sign in to comment.