1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Remove provider-export-permission feature flag (#5263)

* also remove old CipherService and CollectionService methods
  only used by old export code
This commit is contained in:
Thomas Rittson
2025-01-17 08:28:23 +10:00
committed by GitHub
parent 677265b1e1
commit 0c29e9227c
8 changed files with 3 additions and 144 deletions

View File

@ -95,31 +95,4 @@ public class CollectionService : ICollectionService
await _collectionRepository.DeleteUserAsync(collection.Id, organizationUserId);
await _eventService.LogOrganizationUserEventAsync(orgUser, Enums.EventType.OrganizationUser_Updated);
}
public async Task<IEnumerable<Collection>> GetOrganizationCollectionsAsync(Guid organizationId)
{
if (
!await _currentContext.ViewAllCollections(organizationId) &&
!await _currentContext.ManageUsers(organizationId) &&
!await _currentContext.ManageGroups(organizationId) &&
!await _currentContext.AccessImportExport(organizationId)
)
{
throw new NotFoundException();
}
IEnumerable<Collection> orgCollections;
if (await _currentContext.ViewAllCollections(organizationId) || await _currentContext.AccessImportExport(organizationId))
{
// Admins, Owners, Providers and Custom (with collection management or import/export permissions) can access all items even if not assigned to them
orgCollections = await _collectionRepository.GetManyByOrganizationIdAsync(organizationId);
}
else
{
var collections = await _collectionRepository.GetManyByUserIdAsync(_currentContext.UserId.Value);
orgCollections = collections.Where(c => c.OrganizationId == organizationId);
}
return orgCollections;
}
}