1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Remove noncompliant users for new policies (#1951)

This commit is contained in:
Thomas Rittson
2022-04-22 08:13:02 +10:00
committed by GitHub
parent de997a2246
commit 669d44c170

View File

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