using Bit.Core.Entities; using Bit.Core.Models.Data; namespace Bit.Core.Repositories; public interface ICollectionRepository : IRepository { Task GetCountByOrganizationIdAsync(Guid organizationId); /// /// Returns a collection and fetches group/user associations for the collection. /// Task> GetByIdWithAccessAsync(Guid id); /// /// Return all collections that belong to the organization. Does not include any permission details or group/user /// access relationships. /// Task> GetManyByOrganizationIdAsync(Guid organizationId); /// /// Return all collections that belong to the organization. Includes group/user access relationships for each collection. /// Task>> GetManyByOrganizationIdWithAccessAsync(Guid organizationId); Task> GetManyByManyIdsAsync(IEnumerable collectionIds); /// /// Return all collections a user has access to across all of the organization they're a member of. Includes permission /// details for each collection. /// Task> GetManyByUserIdAsync(Guid userId, bool useFlexibleCollections); /// /// Returns all collections for an organization, including permission info for the specified user. /// This does not perform any authorization checks internally! /// Optionally, you can include access relationships for other Groups/Users and the collections. /// Task> GetManyByOrganizationIdWithPermissionsAsync(Guid organizationId, Guid userId, bool includeAccessRelationships); /// /// Returns the collection by Id, including permission info for the specified user. /// This does not perform any authorization checks internally! /// Optionally, you can include access relationships for other Groups/Users and the collection. /// Task GetByIdWithPermissionsAsync(Guid collectionId, Guid? userId, bool includeAccessRelationships); Task CreateAsync(Collection obj, IEnumerable groups, IEnumerable users); Task ReplaceAsync(Collection obj, IEnumerable groups, IEnumerable users); Task DeleteUserAsync(Guid collectionId, Guid organizationUserId); Task UpdateUsersAsync(Guid id, IEnumerable users); Task> GetManyUsersByIdAsync(Guid id); Task DeleteManyAsync(IEnumerable collectionIds); Task CreateOrUpdateAccessForManyAsync(Guid organizationId, IEnumerable collectionIds, IEnumerable users, IEnumerable groups); }