mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
update cipher subvaults
This commit is contained in:
@ -63,13 +63,34 @@ namespace Bit.Core.Models.Api
|
||||
}
|
||||
}
|
||||
|
||||
public class CipherMoveRequestModel : IValidatableObject
|
||||
public class CipherShareRequestModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
public IEnumerable<string> SubvaultIds { get; set; }
|
||||
[Required]
|
||||
public CipherRequestModel Cipher { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(Cipher.OrganizationId))
|
||||
{
|
||||
yield return new ValidationResult("Cipher OrganizationId is required.",
|
||||
new string[] { nameof(Cipher.OrganizationId) });
|
||||
}
|
||||
|
||||
if(!SubvaultIds?.Any() ?? false)
|
||||
{
|
||||
yield return new ValidationResult("You must select at least one subvault.",
|
||||
new string[] { nameof(SubvaultIds) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CipherSubvaultsRequestModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
public IEnumerable<string> SubvaultIds { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if(!SubvaultIds?.Any() ?? false)
|
||||
|
Reference in New Issue
Block a user