mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
return share information with cipher API response
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
using System;
|
||||
using Bit.Core.Domains;
|
||||
using Bit.Core.Models.Data;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
|
||||
namespace Bit.Api.Models
|
||||
{
|
||||
public class CipherResponseModel : ResponseModel
|
||||
{
|
||||
public CipherResponseModel(Cipher cipher, Guid userId)
|
||||
: base("cipher")
|
||||
public CipherResponseModel(Cipher cipher, Guid userId, string obj = "cipher")
|
||||
: base(obj)
|
||||
{
|
||||
if(cipher == null)
|
||||
{
|
||||
@ -40,7 +40,22 @@ namespace Bit.Api.Models
|
||||
public Core.Enums.CipherType Type { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public dynamic Data { get; set; }
|
||||
public string Key { get; set; }
|
||||
public DateTime RevisionDate { get; set; }
|
||||
}
|
||||
|
||||
public class CipherShareResponseModel : CipherResponseModel
|
||||
{
|
||||
public CipherShareResponseModel(CipherShare cipherShare, Guid userId)
|
||||
: base(cipherShare, userId, "cipherShare")
|
||||
{
|
||||
Key = cipherShare.Key;
|
||||
Permissions = cipherShare.Permissions == null ? null :
|
||||
JsonConvert.DeserializeObject<IEnumerable<Core.Enums.SharePermissionType>>(cipherShare.Permissions);
|
||||
Status = cipherShare.Status;
|
||||
}
|
||||
|
||||
public string Key { get; set; }
|
||||
public IEnumerable<Core.Enums.SharePermissionType> Permissions { get; set; }
|
||||
public Core.Enums.ShareStatusType? Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user