From 1cad9869009c7f0bc5ed7584a74ca4ec9ed94107 Mon Sep 17 00:00:00 2001 From: Rui Tome Date: Thu, 19 Oct 2023 12:43:28 +0100 Subject: [PATCH] =?UTF-8?q?[AC-1748]=C2=A0Reverted=20changes=20on=20Organi?= =?UTF-8?q?zationService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implementations/OrganizationService.cs | 31 +++---------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index aa50403261..3dfc7da963 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -54,9 +54,6 @@ public class OrganizationService : IOrganizationService private readonly IProviderUserRepository _providerUserRepository; private readonly ICountNewSmSeatsRequiredQuery _countNewSmSeatsRequiredQuery; private readonly IUpdateSecretsManagerSubscriptionCommand _updateSecretsManagerSubscriptionCommand; - private readonly IFeatureService _featureService; - - private bool FlexibleCollectionsIsEnabled => _featureService.IsEnabled(FeatureFlagKeys.FlexibleCollections, _currentContext); public OrganizationService( IOrganizationRepository organizationRepository, @@ -85,8 +82,7 @@ public class OrganizationService : IOrganizationService IProviderOrganizationRepository providerOrganizationRepository, IProviderUserRepository providerUserRepository, ICountNewSmSeatsRequiredQuery countNewSmSeatsRequiredQuery, - IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand, - IFeatureService featureService) + IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand) { _organizationRepository = organizationRepository; _organizationUserRepository = organizationUserRepository; @@ -115,7 +111,6 @@ public class OrganizationService : IOrganizationService _providerUserRepository = providerUserRepository; _countNewSmSeatsRequiredQuery = countNewSmSeatsRequiredQuery; _updateSecretsManagerSubscriptionCommand = updateSecretsManagerSubscriptionCommand; - _featureService = featureService; } public async Task ReplacePaymentMethodAsync(Guid organizationId, string paymentToken, @@ -2138,17 +2133,9 @@ public class OrganizationService : IOrganizationService return false; } - if (permissions.DeleteAssignedCollections) + if (permissions.DeleteAssignedCollections && !await _currentContext.DeleteAssignedCollections(organizationId)) { - if (FlexibleCollectionsIsEnabled) - { - throw new FeatureUnavailableException("Flexible Collections is ON when it should be OFF."); - } - - if (!await _currentContext.DeleteAssignedCollections(organizationId)) - { - return false; - } + return false; } if (permissions.EditAnyCollection && !await _currentContext.EditAnyCollection(organizationId)) @@ -2156,17 +2143,9 @@ public class OrganizationService : IOrganizationService return false; } - if (permissions.EditAssignedCollections) + if (permissions.EditAssignedCollections && !await _currentContext.EditAssignedCollections(organizationId)) { - if (FlexibleCollectionsIsEnabled) - { - throw new FeatureUnavailableException("Flexible Collections is ON when it should be OFF."); - } - - if (!await _currentContext.EditAssignedCollections(organizationId)) - { - return false; - } + return false; } if (permissions.ManageResetPassword && !await _currentContext.ManageResetPassword(organizationId))