1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)