1
0
mirror of https://github.com/bitwarden/server synced 2026-02-11 05:53:47 +00:00

Added tests

This commit is contained in:
Jared McCannon
2026-01-21 08:17:51 -06:00
parent c266fe7339
commit c3bbed780d
2 changed files with 415 additions and 25 deletions

View File

@@ -104,19 +104,18 @@ public class RestoreOrganizationUserCommand(
var status = OrganizationService.GetPriorActiveOrganizationUserStatusType(organizationUser);
await organizationUserRepository.RestoreAsync(organizationUser.Id, status);
organizationUser.Status = status;
if (organizationUser.UserId.HasValue
&& (await policyRequirementQuery.GetAsync<OrganizationDataOwnershipPolicyRequirement>(organizationUser.UserId
.Value)).State == OrganizationDataOwnershipState.Enabled
&& organizationUser.Status == OrganizationUserStatusType.Confirmed
&& status == OrganizationUserStatusType.Confirmed
&& !string.IsNullOrWhiteSpace(defaultCollectionName))
{
await collectionRepository.CreateDefaultCollectionsAsync(organizationUser.OrganizationId,
[organizationUser.Id],
defaultCollectionName);
}
organizationUser.Status = status;
}
private async Task CheckUserForOtherFreeOrganizationOwnershipAsync(OrganizationUser organizationUser)