Exemple #1
0
        public DtoActionResult ActivatePolicy(int id, bool reRunExisting)
        {
            var policy = _policyServices.GetPolicy(id);
            var result = _policyServices.ActivatePolicy(id, reRunExisting);

            if (result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            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.ActivatePolicy;
                _auditLogService.AddAuditLog(auditLog);
            }
            return(result);
        }