1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-28 23:04:50 -05:00

Remove obsolete permissions code from ImportCiphersController (#4124)

This commit is contained in:
Thomas Rittson 2024-05-27 10:58:04 +10:00 committed by GitHub
parent 62c90bc50a
commit 0d2e953459
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,6 @@ public class ImportCiphersController : Controller
private readonly GlobalSettings _globalSettings;
private readonly ICollectionRepository _collectionRepository;
private readonly IAuthorizationService _authorizationService;
private readonly IOrganizationRepository _organizationRepository;
public ImportCiphersController(
ICipherService cipherService,
@ -43,7 +42,6 @@ public class ImportCiphersController : Controller
_globalSettings = globalSettings;
_collectionRepository = collectionRepository;
_authorizationService = authorizationService;
_organizationRepository = organizationRepository;
}
[HttpPost("import")]
@ -98,13 +96,6 @@ public class ImportCiphersController : Controller
return true;
}
//If flexible collections is disabled the user cannot continue with the import
var orgFlexibleCollections = await _organizationRepository.GetByIdAsync(orgId);
if (!orgFlexibleCollections?.FlexibleCollections ?? false)
{
return false;
}
//Users allowed to import if they CanCreate Collections
if (!(await _authorizationService.AuthorizeAsync(User, collections, BulkCollectionOperations.Create)).Succeeded)
{