2022-06-29 19:46:41 -04:00
|
|
|
|
using System.Security.Claims;
|
2023-10-19 01:27:56 +10:00
|
|
|
|
using Bit.Api.AdminConsole.Controllers;
|
2024-04-19 10:09:18 -04:00
|
|
|
|
using Bit.Api.Auth.Models.Request.Accounts;
|
2025-09-05 12:01:14 +01:00
|
|
|
|
using Bit.Api.Models.Request.Organizations;
|
2024-04-19 10:09:18 -04:00
|
|
|
|
using Bit.Core;
|
2023-11-29 09:18:08 +10:00
|
|
|
|
using Bit.Core.AdminConsole.Entities;
|
2025-03-21 10:07:55 -04:00
|
|
|
|
using Bit.Core.AdminConsole.Enums;
|
2024-04-19 10:09:18 -04:00
|
|
|
|
using Bit.Core.AdminConsole.Enums.Provider;
|
2025-09-05 12:01:14 +01:00
|
|
|
|
using Bit.Core.AdminConsole.Models.Business;
|
2026-01-29 14:11:20 -06:00
|
|
|
|
using Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
|
2025-01-27 10:58:08 +00:00
|
|
|
|
using Bit.Core.AdminConsole.OrganizationFeatures.Organizations.Interfaces;
|
2024-10-16 10:33:00 +01:00
|
|
|
|
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces;
|
2025-03-21 10:07:55 -04:00
|
|
|
|
using Bit.Core.AdminConsole.OrganizationFeatures.Policies;
|
|
|
|
|
|
using Bit.Core.AdminConsole.OrganizationFeatures.Policies.PolicyRequirements;
|
2023-10-27 03:38:29 +10:00
|
|
|
|
using Bit.Core.AdminConsole.Repositories;
|
2023-04-14 13:25:56 -04:00
|
|
|
|
using Bit.Core.Auth.Entities;
|
2023-05-10 12:52:08 -07:00
|
|
|
|
using Bit.Core.Auth.Enums;
|
2023-04-14 13:25:56 -04:00
|
|
|
|
using Bit.Core.Auth.Models.Data;
|
|
|
|
|
|
using Bit.Core.Auth.Repositories;
|
2024-06-14 15:34:47 -04:00
|
|
|
|
using Bit.Core.Billing.Enums;
|
2025-02-27 07:55:46 -05:00
|
|
|
|
using Bit.Core.Billing.Pricing;
|
2025-05-21 09:04:30 -04:00
|
|
|
|
using Bit.Core.Billing.Providers.Services;
|
2021-11-15 19:46:13 +10:00
|
|
|
|
using Bit.Core.Context;
|
2022-01-11 10:40:51 +01:00
|
|
|
|
using Bit.Core.Entities;
|
2023-11-01 11:05:04 -04:00
|
|
|
|
using Bit.Core.Enums;
|
2021-11-15 19:46:13 +10:00
|
|
|
|
using Bit.Core.Exceptions;
|
|
|
|
|
|
using Bit.Core.Repositories;
|
|
|
|
|
|
using Bit.Core.Services;
|
2026-01-29 14:11:20 -06:00
|
|
|
|
using Bit.Core.Test.AdminConsole.AutoFixture;
|
2025-11-19 09:53:30 -06:00
|
|
|
|
using Bit.Core.Test.Billing.Mocks;
|
2024-04-19 10:09:18 -04:00
|
|
|
|
using Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider;
|
2025-11-26 07:38:01 +10:00
|
|
|
|
using Bit.Test.Common.AutoFixture;
|
|
|
|
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
2021-11-15 19:46:13 +10:00
|
|
|
|
using NSubstitute;
|
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
2023-10-19 01:27:56 +10:00
|
|
|
|
namespace Bit.Api.Test.AdminConsole.Controllers;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[ControllerCustomize(typeof(OrganizationsController))]
|
|
|
|
|
|
[SutProviderCustomize]
|
|
|
|
|
|
public class OrganizationsControllerTests
|
2021-11-15 19:46:13 +10:00
|
|
|
|
{
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[Theory, BitAutoData]
|
2021-11-18 21:15:22 +10:00
|
|
|
|
public async Task OrganizationsController_UserCannotLeaveOrganizationThatProvidesKeyConnector(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
|
|
|
|
|
Guid orgId,
|
|
|
|
|
|
User user)
|
2022-08-29 16:06:55 -04:00
|
|
|
|
{
|
2021-11-15 19:46:13 +10:00
|
|
|
|
var ssoConfig = new SsoConfig
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = default,
|
|
|
|
|
|
Data = new SsoConfigurationData
|
|
|
|
|
|
{
|
2023-05-10 12:52:08 -07:00
|
|
|
|
MemberDecryptionType = MemberDecryptionType.KeyConnector
|
2021-11-17 11:46:35 +01:00
|
|
|
|
}.Serialize(),
|
2021-11-15 19:46:13 +10:00
|
|
|
|
Enabled = true,
|
|
|
|
|
|
OrganizationId = orgId,
|
|
|
|
|
|
};
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2021-11-18 21:15:22 +10:00
|
|
|
|
user.UsesKeyConnector = true;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<ICurrentContext>().OrganizationUser(orgId).Returns(true);
|
|
|
|
|
|
sutProvider.GetDependency<ISsoConfigRepository>().GetByOrganizationIdAsync(orgId).Returns(ssoConfig);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).Returns(user);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetOrganizationsClaimingUserAsync(user.Id).Returns(new List<Organization> { null });
|
|
|
|
|
|
|
|
|
|
|
|
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.Leave(orgId));
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2021-11-22 08:22:28 +10:00
|
|
|
|
Assert.Contains("Your organization's Single Sign-On settings prevent you from leaving.",
|
2021-11-15 19:46:13 +10:00
|
|
|
|
exception.Message);
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IRemoveOrganizationUserCommand>().DidNotReceiveWithAnyArgs().UserLeaveAsync(default, default);
|
2021-11-15 19:46:13 +10:00
|
|
|
|
}
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[Theory, BitAutoData]
|
2024-11-07 14:10:00 -05:00
|
|
|
|
public async Task OrganizationsController_UserCannotLeaveOrganizationThatManagesUser(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
|
|
|
|
|
Guid orgId,
|
|
|
|
|
|
User user)
|
2024-11-07 14:10:00 -05:00
|
|
|
|
{
|
|
|
|
|
|
var ssoConfig = new SsoConfig
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = default,
|
|
|
|
|
|
Data = new SsoConfigurationData
|
|
|
|
|
|
{
|
|
|
|
|
|
MemberDecryptionType = MemberDecryptionType.KeyConnector
|
|
|
|
|
|
}.Serialize(),
|
|
|
|
|
|
Enabled = true,
|
|
|
|
|
|
OrganizationId = orgId,
|
|
|
|
|
|
};
|
2025-11-26 07:38:01 +10:00
|
|
|
|
var foundOrg = new Organization
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = orgId
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
sutProvider.GetDependency<ICurrentContext>().OrganizationUser(orgId).Returns(true);
|
|
|
|
|
|
sutProvider.GetDependency<ISsoConfigRepository>().GetByOrganizationIdAsync(orgId).Returns(ssoConfig);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).Returns(user);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetOrganizationsClaimingUserAsync(user.Id).Returns(new List<Organization> { foundOrg });
|
2024-11-07 14:10:00 -05:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.Leave(orgId));
|
2024-11-07 14:10:00 -05:00
|
|
|
|
|
2025-04-08 14:38:44 -05:00
|
|
|
|
Assert.Contains("Claimed user account cannot leave claiming organization. Contact your organization administrator for additional details.",
|
2024-11-07 14:10:00 -05:00
|
|
|
|
exception.Message);
|
|
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IRemoveOrganizationUserCommand>().DidNotReceiveWithAnyArgs().RemoveUserAsync(default, default);
|
2024-11-07 14:10:00 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-18 21:15:22 +10:00
|
|
|
|
[Theory]
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[BitAutoData(true, false)]
|
|
|
|
|
|
[BitAutoData(false, true)]
|
|
|
|
|
|
[BitAutoData(false, false)]
|
2021-11-18 21:15:22 +10:00
|
|
|
|
public async Task OrganizationsController_UserCanLeaveOrganizationThatDoesntProvideKeyConnector(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
bool keyConnectorEnabled,
|
|
|
|
|
|
bool userUsesKeyConnector,
|
|
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
|
|
|
|
|
Guid orgId,
|
|
|
|
|
|
User user)
|
2022-08-29 16:06:55 -04:00
|
|
|
|
{
|
2021-11-18 21:15:22 +10:00
|
|
|
|
var ssoConfig = new SsoConfig
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = default,
|
|
|
|
|
|
Data = new SsoConfigurationData
|
|
|
|
|
|
{
|
2023-05-10 12:52:08 -07:00
|
|
|
|
MemberDecryptionType = keyConnectorEnabled
|
|
|
|
|
|
? MemberDecryptionType.KeyConnector
|
|
|
|
|
|
: MemberDecryptionType.MasterPassword
|
2021-11-18 21:15:22 +10:00
|
|
|
|
}.Serialize(),
|
|
|
|
|
|
Enabled = true,
|
|
|
|
|
|
OrganizationId = orgId,
|
|
|
|
|
|
};
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2021-11-18 21:15:22 +10:00
|
|
|
|
user.UsesKeyConnector = userUsesKeyConnector;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<ICurrentContext>().OrganizationUser(orgId).Returns(true);
|
|
|
|
|
|
sutProvider.GetDependency<ISsoConfigRepository>().GetByOrganizationIdAsync(orgId).Returns(ssoConfig);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).Returns(user);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetOrganizationsClaimingUserAsync(user.Id).Returns(new List<Organization>());
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.Sut.Leave(orgId);
|
2024-10-16 10:33:00 +01:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IRemoveOrganizationUserCommand>().Received(1).UserLeaveAsync(orgId, user.Id);
|
2021-11-15 19:46:13 +10:00
|
|
|
|
}
|
2023-11-01 11:05:04 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[Theory, BitAutoData]
|
2024-04-19 10:09:18 -04:00
|
|
|
|
public async Task Delete_OrganizationIsConsolidatedBillingClient_ScalesProvidersSeats(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
2024-04-19 10:09:18 -04:00
|
|
|
|
Provider provider,
|
|
|
|
|
|
Organization organization,
|
|
|
|
|
|
User user,
|
|
|
|
|
|
Guid organizationId,
|
|
|
|
|
|
SecretVerificationRequestModel requestModel)
|
|
|
|
|
|
{
|
|
|
|
|
|
organization.Status = OrganizationStatusType.Managed;
|
|
|
|
|
|
organization.PlanType = PlanType.TeamsMonthly;
|
|
|
|
|
|
organization.Seats = 10;
|
|
|
|
|
|
|
|
|
|
|
|
provider.Type = ProviderType.Msp;
|
|
|
|
|
|
provider.Status = ProviderStatusType.Billable;
|
|
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<ICurrentContext>().OrganizationOwner(organizationId).Returns(true);
|
|
|
|
|
|
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId).Returns(organization);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).Returns(user);
|
|
|
|
|
|
sutProvider.GetDependency<IUserService>().VerifySecretAsync(user, requestModel.Secret).Returns(true);
|
|
|
|
|
|
sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organization.Id).Returns(provider);
|
2024-04-19 10:09:18 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.Sut.Delete(organizationId.ToString(), requestModel);
|
2024-04-19 10:09:18 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IProviderBillingService>().Received(1)
|
2024-05-23 10:17:00 -04:00
|
|
|
|
.ScaleSeats(provider, organization.PlanType, -organization.Seats.Value);
|
2024-04-19 10:09:18 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IOrganizationDeleteCommand>().Received(1).DeleteAsync(organization);
|
2024-04-19 10:09:18 -04:00
|
|
|
|
}
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[Theory, BitAutoData]
|
2025-03-21 10:07:55 -04:00
|
|
|
|
public async Task GetAutoEnrollStatus_WithPolicyRequirementsEnabled_ReturnsOrganizationAutoEnrollStatus_WithResetPasswordEnabledTrue(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
2025-03-21 10:07:55 -04:00
|
|
|
|
User user,
|
|
|
|
|
|
Organization organization,
|
2025-11-26 07:38:01 +10:00
|
|
|
|
OrganizationUser organizationUser)
|
2025-03-21 10:07:55 -04:00
|
|
|
|
{
|
2025-11-26 07:38:01 +10:00
|
|
|
|
var policyRequirement = new ResetPasswordPolicyRequirement { AutoEnrollOrganizations = [organization.Id] };
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).Returns(user);
|
|
|
|
|
|
sutProvider.GetDependency<IOrganizationRepository>().GetByIdentifierAsync(organization.Id.ToString()).Returns(organization);
|
|
|
|
|
|
sutProvider.GetDependency<IFeatureService>().IsEnabled(FeatureFlagKeys.PolicyRequirements).Returns(true);
|
|
|
|
|
|
sutProvider.GetDependency<IOrganizationUserRepository>().GetByOrganizationAsync(organization.Id, user.Id).Returns(organizationUser);
|
|
|
|
|
|
sutProvider.GetDependency<IPolicyRequirementQuery>().GetAsync<ResetPasswordPolicyRequirement>(user.Id).Returns(policyRequirement);
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
var result = await sutProvider.Sut.GetAutoEnrollStatus(organization.Id.ToString());
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IUserService>().Received(1).GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>());
|
|
|
|
|
|
await sutProvider.GetDependency<IOrganizationRepository>().Received(1).GetByIdentifierAsync(organization.Id.ToString());
|
|
|
|
|
|
await sutProvider.GetDependency<IPolicyRequirementQuery>().Received(1).GetAsync<ResetPasswordPolicyRequirement>(user.Id);
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
|
|
|
|
|
Assert.True(result.ResetPasswordEnabled);
|
|
|
|
|
|
Assert.Equal(result.Id, organization.Id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[Theory, BitAutoData]
|
2025-03-21 10:07:55 -04:00
|
|
|
|
public async Task GetAutoEnrollStatus_WithPolicyRequirementsDisabled_ReturnsOrganizationAutoEnrollStatus_WithResetPasswordEnabledTrue(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
|
|
|
|
|
User user,
|
|
|
|
|
|
Organization organization,
|
2026-01-29 14:11:20 -06:00
|
|
|
|
OrganizationUser organizationUser,
|
|
|
|
|
|
[Policy(PolicyType.ResetPassword, data: "{\"AutoEnrollEnabled\": true}")] PolicyStatus policy)
|
2025-03-21 10:07:55 -04:00
|
|
|
|
{
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).Returns(user);
|
|
|
|
|
|
sutProvider.GetDependency<IOrganizationRepository>().GetByIdentifierAsync(organization.Id.ToString()).Returns(organization);
|
|
|
|
|
|
sutProvider.GetDependency<IFeatureService>().IsEnabled(FeatureFlagKeys.PolicyRequirements).Returns(false);
|
|
|
|
|
|
sutProvider.GetDependency<IOrganizationUserRepository>().GetByOrganizationAsync(organization.Id, user.Id).Returns(organizationUser);
|
2026-01-29 14:11:20 -06:00
|
|
|
|
sutProvider.GetDependency<IPolicyQuery>().RunAsync(organization.Id, PolicyType.ResetPassword).Returns(policy);
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
var result = await sutProvider.Sut.GetAutoEnrollStatus(organization.Id.ToString());
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IUserService>().Received(1).GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>());
|
|
|
|
|
|
await sutProvider.GetDependency<IOrganizationRepository>().Received(1).GetByIdentifierAsync(organization.Id.ToString());
|
|
|
|
|
|
await sutProvider.GetDependency<IPolicyRequirementQuery>().Received(0).GetAsync<ResetPasswordPolicyRequirement>(user.Id);
|
2026-01-29 14:11:20 -06:00
|
|
|
|
await sutProvider.GetDependency<IPolicyQuery>().Received(1).RunAsync(organization.Id, PolicyType.ResetPassword);
|
2025-03-21 10:07:55 -04:00
|
|
|
|
|
|
|
|
|
|
Assert.True(result.ResetPasswordEnabled);
|
|
|
|
|
|
}
|
2025-09-05 12:01:14 +01:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
[Theory, BitAutoData]
|
2025-09-05 12:01:14 +01:00
|
|
|
|
public async Task PutCollectionManagement_ValidRequest_Success(
|
2025-11-26 07:38:01 +10:00
|
|
|
|
SutProvider<OrganizationsController> sutProvider,
|
2025-09-05 12:01:14 +01:00
|
|
|
|
Organization organization,
|
|
|
|
|
|
OrganizationCollectionManagementUpdateRequestModel model)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Arrange
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<ICurrentContext>().OrganizationOwner(organization.Id).Returns(true);
|
2025-09-05 12:01:14 +01:00
|
|
|
|
|
2025-11-19 09:53:30 -06:00
|
|
|
|
var plan = MockPlans.Get(PlanType.EnterpriseAnnually);
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<IPricingClient>().GetPlan(Arg.Any<PlanType>()).Returns(plan);
|
2025-09-05 12:01:14 +01:00
|
|
|
|
|
2025-11-26 07:38:01 +10:00
|
|
|
|
sutProvider.GetDependency<IOrganizationService>()
|
2025-09-05 12:01:14 +01:00
|
|
|
|
.UpdateCollectionManagementSettingsAsync(
|
|
|
|
|
|
organization.Id,
|
|
|
|
|
|
Arg.Is<OrganizationCollectionManagementSettings>(s =>
|
|
|
|
|
|
s.LimitCollectionCreation == model.LimitCollectionCreation &&
|
|
|
|
|
|
s.LimitCollectionDeletion == model.LimitCollectionDeletion &&
|
|
|
|
|
|
s.LimitItemDeletion == model.LimitItemDeletion &&
|
|
|
|
|
|
s.AllowAdminAccessToAllCollectionItems == model.AllowAdminAccessToAllCollectionItems))
|
|
|
|
|
|
.Returns(organization);
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.Sut.PutCollectionManagement(organization.Id, model);
|
2025-09-05 12:01:14 +01:00
|
|
|
|
|
|
|
|
|
|
// Assert
|
2025-11-26 07:38:01 +10:00
|
|
|
|
await sutProvider.GetDependency<IOrganizationService>()
|
2025-09-05 12:01:14 +01:00
|
|
|
|
.Received(1)
|
|
|
|
|
|
.UpdateCollectionManagementSettingsAsync(
|
|
|
|
|
|
organization.Id,
|
|
|
|
|
|
Arg.Is<OrganizationCollectionManagementSettings>(s =>
|
|
|
|
|
|
s.LimitCollectionCreation == model.LimitCollectionCreation &&
|
|
|
|
|
|
s.LimitCollectionDeletion == model.LimitCollectionDeletion &&
|
|
|
|
|
|
s.LimitItemDeletion == model.LimitItemDeletion &&
|
|
|
|
|
|
s.AllowAdminAccessToAllCollectionItems == model.AllowAdminAccessToAllCollectionItems));
|
|
|
|
|
|
}
|
2021-11-15 19:46:13 +10:00
|
|
|
|
}
|