1
0
mirror of https://github.com/bitwarden/server synced 2026-01-03 17:14:00 +00:00

[PM-24595] [PM-24596] Remove feature flag usage/definition for deleting users with no mp on import (#6313)

* chore: remove dc prevent non-mp users from being deleted feature flag, refs PM-24596

* chore: format, refs PM-24596
This commit is contained in:
Vincent Salucci
2025-09-11 08:25:57 -05:00
committed by GitHub
parent 51c9958ff1
commit aab50ef5c4
4 changed files with 2 additions and 18 deletions

View File

@@ -22,7 +22,6 @@ public class ImportOrganizationUsersAndGroupsCommand : IImportOrganizationUsersA
private readonly IGroupRepository _groupRepository;
private readonly IEventService _eventService;
private readonly IOrganizationService _organizationService;
private readonly IFeatureService _featureService;
private readonly EventSystemUser _EventSystemUser = EventSystemUser.PublicApi;
@@ -31,8 +30,7 @@ public class ImportOrganizationUsersAndGroupsCommand : IImportOrganizationUsersA
IPaymentService paymentService,
IGroupRepository groupRepository,
IEventService eventService,
IOrganizationService organizationService,
IFeatureService featureService)
IOrganizationService organizationService)
{
_organizationRepository = organizationRepository;
_organizationUserRepository = organizationUserRepository;
@@ -40,7 +38,6 @@ public class ImportOrganizationUsersAndGroupsCommand : IImportOrganizationUsersA
_groupRepository = groupRepository;
_eventService = eventService;
_organizationService = organizationService;
_featureService = featureService;
}
/// <summary>
@@ -238,8 +235,7 @@ public class ImportOrganizationUsersAndGroupsCommand : IImportOrganizationUsersA
importUserData.ExistingExternalUsersIdDict.ContainsKey(u.ExternalId))
.ToList();
if (_featureService.IsEnabled(FeatureFlagKeys.DirectoryConnectorPreventUserRemoval) &&
usersToDelete.Any(u => !u.HasMasterPassword))
if (usersToDelete.Any(u => !u.HasMasterPassword))
{
// Removing users without an MP will put their account in an unrecoverable state.
// We allow this during normal syncs for offboarding, but overwriteExisting risks bricking every user in