1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

[AC-1104] [AC-1265] Allow custom users with import/export permission to get export organization ciphers (#2837)

* [AC-1265] Allow users with custom import/export permission to get organization ciphers

* [AC-1104] Fix to allow custom users with import/export permission to access all collections/ciphers in their organization

* [AC-1104] Remove redundant OrganizationAdmin checks
This commit is contained in:
Shane Melton
2023-05-30 16:30:19 -07:00
committed by GitHub
parent ab1204e859
commit 767993e266
2 changed files with 6 additions and 6 deletions

View File

@ -98,15 +98,15 @@ public class CollectionService : ICollectionService
public async Task<IEnumerable<Collection>> GetOrganizationCollections(Guid organizationId)
{
if (!await _currentContext.ViewAllCollections(organizationId) && !await _currentContext.ManageUsers(organizationId) && !await _currentContext.ManageGroups(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.OrganizationAdmin(organizationId) || await _currentContext.ViewAllCollections(organizationId))
if (await _currentContext.ViewAllCollections(organizationId) || await _currentContext.AccessImportExport(organizationId))
{
// Admins, Owners, Providers and Custom (with collection management permissions) can access all items even if not assigned to them
// 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