Example #1
0
        public DtoActionResult Post(EntityPolicy policy)
        {
            var result = _policyServices.AddPolicy(policy);

            if (result.Success)
            {
                var auditLog = new EntityAuditLog();
                auditLog.ObjectType = "Policy";
                auditLog.ObjectId   = result.Id;
                auditLog.ObjectName = policy.Name;
                auditLog.ObjectJson = JsonConvert.SerializeObject(policy);
                auditLog.UserId     = _userId;
                auditLog.AuditType  = EnumAuditEntry.AuditType.Create;
                _auditLogService.AddAuditLog(auditLog);
            }
            return(result);
        }