From 669d44c170d6d9e3417da46e0e21ccd8de92860e Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 22 Apr 2022 08:13:02 +1000 Subject: [PATCH] Remove noncompliant users for new policies (#1951) --- src/Core/Services/Implementations/PolicyService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/Services/Implementations/PolicyService.cs b/src/Core/Services/Implementations/PolicyService.cs index 14e107e80..497a4b478 100644 --- a/src/Core/Services/Implementations/PolicyService.cs +++ b/src/Core/Services/Implementations/PolicyService.cs @@ -84,7 +84,8 @@ namespace Bit.Core.Services { policy.CreationDate = now; } - else if (policy.Enabled) + + if (policy.Enabled) { var currentPolicy = await _policyRepository.GetByIdAsync(policy.Id); if (!currentPolicy?.Enabled ?? true) @@ -95,7 +96,7 @@ namespace Bit.Core.Services ou.Status != Enums.OrganizationUserStatusType.Invited && ou.Type != Enums.OrganizationUserType.Owner && ou.Type != Enums.OrganizationUserType.Admin && ou.UserId != savingUserId); - switch (currentPolicy.Type) + switch (policy.Type) { case Enums.PolicyType.TwoFactorAuthentication: foreach (var orgUser in removableOrgUsers)