From c6c0f95ed783fcec05f376fd3365400cc4757af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Mon, 23 Jan 2023 16:05:12 +0000 Subject: [PATCH] [EC-741 Single Organization policy exception when an Invited status user is also in the Revoked status (#2568) * [EC-741] Check that OrganizationUsers to be removed have a UserId * [EC-741] Filtering Revoked users in query for users to remove from organization --- src/Core/Services/Implementations/PolicyService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Services/Implementations/PolicyService.cs b/src/Core/Services/Implementations/PolicyService.cs index 938975f591..a8d4f7ac93 100644 --- a/src/Core/Services/Implementations/PolicyService.cs +++ b/src/Core/Services/Implementations/PolicyService.cs @@ -89,7 +89,7 @@ public class PolicyService : IPolicyService var orgUsers = await _organizationUserRepository.GetManyDetailsByOrganizationAsync( policy.OrganizationId); var removableOrgUsers = orgUsers.Where(ou => - ou.Status != Enums.OrganizationUserStatusType.Invited && + ou.Status != Enums.OrganizationUserStatusType.Invited && ou.Status != Enums.OrganizationUserStatusType.Revoked && ou.Type != Enums.OrganizationUserType.Owner && ou.Type != Enums.OrganizationUserType.Admin && ou.UserId != savingUserId); switch (policy.Type)