mirror of
https://github.com/bitwarden/server.git
synced 2025-06-27 22:26:13 -05:00

* Implement CreateCollectionCommand to handle collection creation with organization checks and access permissions. * Introduce ICreateCollectionCommand interface for defining the collection creation contract. * Add unit tests for CreateCollectionCommand to validate various scenarios including permission checks and error handling.
18 lines
739 B
C#
18 lines
739 B
C#
using Bit.Core.Entities;
|
|
using Bit.Core.Models.Data;
|
|
|
|
namespace Bit.Core.OrganizationFeatures.OrganizationCollections.Interfaces;
|
|
|
|
public interface ICreateCollectionCommand
|
|
{
|
|
/// <summary>
|
|
/// Creates a new collection.
|
|
/// </summary>
|
|
/// <param name="collection">The collection to create.</param>
|
|
/// <param name="groups">(Optional) The groups that will have access to the collection.</param>
|
|
/// <param name="users">(Optional) The users that will have access to the collection.</param>
|
|
/// <returns>The created collection.</returns>
|
|
Task<Collection> CreateAsync(Collection collection, IEnumerable<CollectionAccessSelection> groups = null,
|
|
IEnumerable<CollectionAccessSelection> users = null);
|
|
}
|