mirror of
https://github.com/bitwarden/server
synced 2025-12-16 08:13:33 +00:00
* Remove PolicyService.SaveAsync and use command instead * Delete feature flag definition * Add public api integration tests
20 lines
648 B
C#
20 lines
648 B
C#
using System.Text.Json;
|
|
using Bit.Core.AdminConsole.Enums;
|
|
using Bit.Core.AdminConsole.Models.Data;
|
|
using Bit.Core.AdminConsole.OrganizationFeatures.Policies.Models;
|
|
using Bit.Core.Enums;
|
|
|
|
namespace Bit.Api.AdminConsole.Public.Models.Request;
|
|
|
|
public class PolicyUpdateRequestModel : PolicyBaseModel
|
|
{
|
|
public PolicyUpdate ToPolicyUpdate(Guid organizationId, PolicyType type) => new()
|
|
{
|
|
Type = type,
|
|
OrganizationId = organizationId,
|
|
Data = Data != null ? JsonSerializer.Serialize(Data) : null,
|
|
Enabled = Enabled.GetValueOrDefault(),
|
|
PerformedBy = new SystemUser(EventSystemUser.PublicApi)
|
|
};
|
|
}
|