mirror of
https://github.com/bitwarden/server
synced 2025-12-12 22:33:45 +00:00
25 lines
632 B
C#
25 lines
632 B
C#
using System;
|
|
using Bit.Core.Models.Table;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Bit.Api.Models.Public.Request
|
|
{
|
|
public class PolicyUpdateRequestModel : PolicyBaseModel
|
|
{
|
|
public Policy ToPolicy(Guid orgId)
|
|
{
|
|
return ToPolicy(new Policy
|
|
{
|
|
OrganizationId = orgId
|
|
});
|
|
}
|
|
|
|
public virtual Policy ToPolicy(Policy existingPolicy)
|
|
{
|
|
existingPolicy.Enabled = Enabled.GetValueOrDefault();
|
|
existingPolicy.Data = Data != null ? JsonConvert.SerializeObject(Data) : null;
|
|
return existingPolicy;
|
|
}
|
|
}
|
|
}
|