mirror of
https://github.com/bitwarden/server.git
synced 2025-02-25 03:21:46 +01:00
[EC-235] Give Admins (and above) access to all items (#2036)
This commit is contained in:
parent
b070e9a387
commit
f602df2eb9
@ -225,10 +225,9 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
IEnumerable<Cipher> orgCiphers;
|
||||
if (await _currentContext.OrganizationOwner(orgIdGuid))
|
||||
if (await _currentContext.OrganizationAdmin(orgIdGuid))
|
||||
{
|
||||
// User may be a Provider for the organization, in which case GetManyByUserIdAsync won't return any results
|
||||
// But they have access to all organization ciphers, so we can safely get by orgId instead
|
||||
// Admins, Owners and Providers can access all items even if not assigned to them
|
||||
orgCiphers = await _cipherRepository.GetManyByOrganizationIdAsync(orgIdGuid);
|
||||
}
|
||||
else
|
||||
|
@ -88,10 +88,9 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
IEnumerable<Collection> orgCollections;
|
||||
if (await _currentContext.OrganizationOwner(orgIdGuid))
|
||||
if (await _currentContext.OrganizationAdmin(orgIdGuid))
|
||||
{
|
||||
// User may be a Provider for the organization, in which case GetManyByUserIdAsync won't return any results
|
||||
// But they have access to all organization collections, so we can safely get by orgId instead
|
||||
// Admins, Owners and Providers can access all items even if not assigned to them
|
||||
orgCollections = await _collectionRepository.GetManyByOrganizationIdAsync(orgIdGuid);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user