mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 09:32:48 -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:
@ -870,15 +870,15 @@ public class CipherService : ICipherService
|
||||
|
||||
public async Task<(IEnumerable<CipherOrganizationDetails>, Dictionary<Guid, IGrouping<Guid, CollectionCipher>>)> GetOrganizationCiphers(Guid userId, Guid organizationId)
|
||||
{
|
||||
if (!await _currentContext.ViewAllCollections(organizationId) && !await _currentContext.AccessReports(organizationId))
|
||||
if (!await _currentContext.ViewAllCollections(organizationId) && !await _currentContext.AccessReports(organizationId) && !await _currentContext.AccessImportExport(organizationId))
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
IEnumerable<CipherOrganizationDetails> orgCiphers;
|
||||
if (await _currentContext.OrganizationAdmin(organizationId))
|
||||
if (await _currentContext.AccessImportExport(organizationId))
|
||||
{
|
||||
// Admins, Owners and Providers can access all items even if not assigned to them
|
||||
// Admins, Owners, Providers and Custom (with import/export permission) can access all items even if not assigned to them
|
||||
orgCiphers = await _cipherRepository.GetManyOrganizationDetailsByOrganizationIdAsync(organizationId);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user