1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-22 21:51:22 +01:00

[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
This commit is contained in:
Rui Tomé 2023-01-23 16:05:12 +00:00 committed by GitHub
parent 266d426c80
commit c6c0f95ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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