mirror of
https://github.com/bitwarden/server.git
synced 2025-07-19 00:21:35 -05:00
[PM-2383] Bulk collection assignment (#3919)
* [PM-2383] Add bulk add/remove collection cipher repository methods * [PM-2383] Add additional authorization helpers for CiphersControlle * [PM-2383] Add /bulk-collections endpoint to CiphersController.cs * [PM-2383] Add EF implementation for new CollectionCipherRepository methods * [PM-2383] Ensure V1 logic only applies when the flag is enabled for new bulk functionality
This commit is contained in:
@ -11,4 +11,22 @@ public interface ICollectionCipherRepository
|
||||
Task UpdateCollectionsForAdminAsync(Guid cipherId, Guid organizationId, IEnumerable<Guid> collectionIds);
|
||||
Task UpdateCollectionsForCiphersAsync(IEnumerable<Guid> cipherIds, Guid userId, Guid organizationId,
|
||||
IEnumerable<Guid> collectionIds, bool useFlexibleCollections);
|
||||
|
||||
/// <summary>
|
||||
/// Add the specified collections to the specified ciphers. If a cipher already belongs to a requested collection,
|
||||
/// no action is taken.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method does not perform any authorization checks.
|
||||
/// </remarks>
|
||||
Task AddCollectionsForManyCiphersAsync(Guid organizationId, IEnumerable<Guid> cipherIds, IEnumerable<Guid> collectionIds);
|
||||
|
||||
/// <summary>
|
||||
/// Remove the specified collections from the specified ciphers. If a cipher does not belong to a requested collection,
|
||||
/// no action is taken.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method does not perform any authorization checks.
|
||||
/// </remarks>
|
||||
Task RemoveCollectionsForManyCiphersAsync(Guid organizationId, IEnumerable<Guid> cipherIds, IEnumerable<Guid> collectionIds);
|
||||
}
|
||||
|
@ -8,6 +8,26 @@ public class CipherDetails : CipherOrganizationDetails
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool ViewPassword { get; set; }
|
||||
|
||||
public CipherDetails() { }
|
||||
|
||||
public CipherDetails(CipherOrganizationDetails cipher)
|
||||
{
|
||||
Id = cipher.Id;
|
||||
UserId = cipher.UserId;
|
||||
OrganizationId = cipher.OrganizationId;
|
||||
Type = cipher.Type;
|
||||
Data = cipher.Data;
|
||||
Favorites = cipher.Favorites;
|
||||
Folders = cipher.Folders;
|
||||
Attachments = cipher.Attachments;
|
||||
CreationDate = cipher.CreationDate;
|
||||
RevisionDate = cipher.RevisionDate;
|
||||
DeletedDate = cipher.DeletedDate;
|
||||
Reprompt = cipher.Reprompt;
|
||||
Key = cipher.Key;
|
||||
OrganizationUseTotp = cipher.OrganizationUseTotp;
|
||||
}
|
||||
}
|
||||
|
||||
public class CipherDetailsWithCollections : CipherDetails
|
||||
|
Reference in New Issue
Block a user