mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 09:32:48 -05:00
[PM-11360] Remove export permission for providers (#5051)
- also fix managed collections export from CLI
This commit is contained in:
@ -27,4 +27,14 @@ public interface IOrganizationCiphersQuery
|
||||
/// </summary>
|
||||
/// <exception cref="FeatureUnavailableException"></exception>
|
||||
Task<IEnumerable<CipherOrganizationDetails>> GetUnassignedOrganizationCiphers(Guid organizationId);
|
||||
|
||||
/// <summary>
|
||||
/// Returns ciphers belonging to the organization that are in the specified collections.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Note that the <see cref="CipherOrganizationDetailsWithCollections.CollectionIds"/> will include all collections
|
||||
/// the cipher belongs to even if it is not in the <paramref name="collectionIds"/> parameter.
|
||||
/// </remarks>
|
||||
public Task<IEnumerable<CipherOrganizationDetailsWithCollections>> GetOrganizationCiphersByCollectionIds(
|
||||
Guid organizationId, IEnumerable<Guid> collectionIds);
|
||||
}
|
||||
|
@ -52,4 +52,13 @@ public class OrganizationCiphersQuery : IOrganizationCiphersQuery
|
||||
{
|
||||
return await _cipherRepository.GetManyUnassignedOrganizationDetailsByOrganizationIdAsync(organizationId);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IEnumerable<CipherOrganizationDetailsWithCollections>> GetOrganizationCiphersByCollectionIds(
|
||||
Guid organizationId, IEnumerable<Guid> collectionIds)
|
||||
{
|
||||
var managedCollectionIds = collectionIds.ToHashSet();
|
||||
var allOrganizationCiphers = await GetAllOrganizationCiphers(organizationId);
|
||||
return allOrganizationCiphers.Where(c => c.CollectionIds.Intersect(managedCollectionIds).Any());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user