1
0
mirror of https://github.com/bitwarden/server synced 2025-12-15 15:53:59 +00:00
Files
server/src/Core/Vault/Queries/IOrganizationCiphersQuery.cs
Shane Melton 636f716d62 [AC-1124] Restrict admins from accessing items in Collections tab (#3676)
* [AC-1124] Add GetManyUnassignedOrganizationDetailsByOrganizationIdAsync to the CipherRepository

* [AC-1124] Introduce IOrganizationCiphersQuery.cs to replace some CipherService queries

* [AC-1124] Add additional CipherDetails model that includes CollectionIds

* [AC-1124] Update CiphersController and response models
- Add new endpoint for assigned ciphers
- Update existing endpoint to only return all ciphers when feature flag is enabled the user has access

* [AC-1124] Add migration script

* [AC-1124] Add follow up ticket for Todos

* [AC-1124] Fix feature service usage after merge with main

* [AC-1124] Optimize unassigned ciphers query

* [AC-1124] Update migration script date

* [AC-1124] Update migration script date

* [AC-1124] Formatting
2024-02-08 14:07:58 -08:00

31 lines
1.3 KiB
C#

using Bit.Core.Exceptions;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Vault.Queries;
/// <summary>
/// Helper queries for retrieving cipher details belonging to an organization including collection information.
/// </summary>
/// <remarks>It does not perform any internal authorization checks.</remarks>
public interface IOrganizationCiphersQuery
{
/// <summary>
/// Returns ciphers belonging to the organization that the user has been assigned to via collections.
/// </summary>
/// <exception cref="FeatureUnavailableException"></exception>
public Task<IEnumerable<CipherDetailsWithCollections>> GetOrganizationCiphersForUser(Guid organizationId, Guid userId);
/// <summary>
/// Returns all ciphers belonging to the organization.
/// </summary>
/// <param name="organizationId"></param>
/// <exception cref="FeatureUnavailableException"></exception>
public Task<IEnumerable<CipherOrganizationDetailsWithCollections>> GetAllOrganizationCiphers(Guid organizationId);
/// <summary>
/// Returns ciphers belonging to the organization that are not assigned to any collection.
/// </summary>
/// <exception cref="FeatureUnavailableException"></exception>
Task<IEnumerable<CipherOrganizationDetails>> GetUnassignedOrganizationCiphers(Guid organizationId);
}