From f3bda4288a3f828dd4f52b60122d6bb951c279fd Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Fri, 13 Oct 2023 10:38:44 -0400 Subject: [PATCH] PM-3275 - CurrentContextExtensions.cs - Refactor AnyOrgUserHasManageResetPasswordPermission per PR feedback to remove unnecessary var. --- src/Core/Context/CurrentContextExtensions.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Core/Context/CurrentContextExtensions.cs b/src/Core/Context/CurrentContextExtensions.cs index 03380bf84e83..5038e3481520 100644 --- a/src/Core/Context/CurrentContextExtensions.cs +++ b/src/Core/Context/CurrentContextExtensions.cs @@ -7,16 +7,14 @@ public static class CurrentContextExtensions public static async Task AnyOrgUserHasManageResetPasswordPermission(this ICurrentContext currentContext, ICollection 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; } }