mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 09:32:48 -05:00
[AC-1748] Reverted changes on OrganizationService
This commit is contained in:
@ -54,9 +54,6 @@ public class OrganizationService : IOrganizationService
|
|||||||
private readonly IProviderUserRepository _providerUserRepository;
|
private readonly IProviderUserRepository _providerUserRepository;
|
||||||
private readonly ICountNewSmSeatsRequiredQuery _countNewSmSeatsRequiredQuery;
|
private readonly ICountNewSmSeatsRequiredQuery _countNewSmSeatsRequiredQuery;
|
||||||
private readonly IUpdateSecretsManagerSubscriptionCommand _updateSecretsManagerSubscriptionCommand;
|
private readonly IUpdateSecretsManagerSubscriptionCommand _updateSecretsManagerSubscriptionCommand;
|
||||||
private readonly IFeatureService _featureService;
|
|
||||||
|
|
||||||
private bool FlexibleCollectionsIsEnabled => _featureService.IsEnabled(FeatureFlagKeys.FlexibleCollections, _currentContext);
|
|
||||||
|
|
||||||
public OrganizationService(
|
public OrganizationService(
|
||||||
IOrganizationRepository organizationRepository,
|
IOrganizationRepository organizationRepository,
|
||||||
@ -85,8 +82,7 @@ public class OrganizationService : IOrganizationService
|
|||||||
IProviderOrganizationRepository providerOrganizationRepository,
|
IProviderOrganizationRepository providerOrganizationRepository,
|
||||||
IProviderUserRepository providerUserRepository,
|
IProviderUserRepository providerUserRepository,
|
||||||
ICountNewSmSeatsRequiredQuery countNewSmSeatsRequiredQuery,
|
ICountNewSmSeatsRequiredQuery countNewSmSeatsRequiredQuery,
|
||||||
IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand,
|
IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand)
|
||||||
IFeatureService featureService)
|
|
||||||
{
|
{
|
||||||
_organizationRepository = organizationRepository;
|
_organizationRepository = organizationRepository;
|
||||||
_organizationUserRepository = organizationUserRepository;
|
_organizationUserRepository = organizationUserRepository;
|
||||||
@ -115,7 +111,6 @@ public class OrganizationService : IOrganizationService
|
|||||||
_providerUserRepository = providerUserRepository;
|
_providerUserRepository = providerUserRepository;
|
||||||
_countNewSmSeatsRequiredQuery = countNewSmSeatsRequiredQuery;
|
_countNewSmSeatsRequiredQuery = countNewSmSeatsRequiredQuery;
|
||||||
_updateSecretsManagerSubscriptionCommand = updateSecretsManagerSubscriptionCommand;
|
_updateSecretsManagerSubscriptionCommand = updateSecretsManagerSubscriptionCommand;
|
||||||
_featureService = featureService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ReplacePaymentMethodAsync(Guid organizationId, string paymentToken,
|
public async Task ReplacePaymentMethodAsync(Guid organizationId, string paymentToken,
|
||||||
@ -2138,17 +2133,9 @@ public class OrganizationService : IOrganizationService
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.DeleteAssignedCollections)
|
if (permissions.DeleteAssignedCollections && !await _currentContext.DeleteAssignedCollections(organizationId))
|
||||||
{
|
{
|
||||||
if (FlexibleCollectionsIsEnabled)
|
return false;
|
||||||
{
|
|
||||||
throw new FeatureUnavailableException("Flexible Collections is ON when it should be OFF.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!await _currentContext.DeleteAssignedCollections(organizationId))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.EditAnyCollection && !await _currentContext.EditAnyCollection(organizationId))
|
if (permissions.EditAnyCollection && !await _currentContext.EditAnyCollection(organizationId))
|
||||||
@ -2156,17 +2143,9 @@ public class OrganizationService : IOrganizationService
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.EditAssignedCollections)
|
if (permissions.EditAssignedCollections && !await _currentContext.EditAssignedCollections(organizationId))
|
||||||
{
|
{
|
||||||
if (FlexibleCollectionsIsEnabled)
|
return false;
|
||||||
{
|
|
||||||
throw new FeatureUnavailableException("Flexible Collections is ON when it should be OFF.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!await _currentContext.EditAssignedCollections(organizationId))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.ManageResetPassword && !await _currentContext.ManageResetPassword(organizationId))
|
if (permissions.ManageResetPassword && !await _currentContext.ManageResetPassword(organizationId))
|
||||||
|
Reference in New Issue
Block a user