Exemple #1
0
        public IActionResult DeleteGroup(string ids)
        {
            foreach (var id in ids.Split(',').ToList().ConvertAll(Guid.Parse))
            {
                _relationshipService.Delete(x => x.FromType == ObjectType.Container && x.ToType == ObjectType.AssetGroup && x.ToId == id);
                _relationshipService.Delete(x => x.FromType == ObjectType.AssetGroup && x.ToType == ObjectType.Asset && x.FromId == id);
                _auditTrailService.LogAction(AuditTrailAction.RemoveAssetGroup, id, new AuditTrailPayloadModel()
                {
                    Data = JsonConvert.SerializeObject(id)
                });
            }

            return(Ok());
        }
        public async Task <IActionResult> Delete([FromBody] CreateDeleteRelationshipRequest request)
        {
            try
            {
                await _relationshipService.Delete(request);

                return(new NoContentResult());
            }
            catch (InvalidOperationException e)
            {
                return(NotFound(new { message = e.Message }));
            }
        }
Exemple #3
0
 public bool Delete(Guid assetId, Guid id)
 {
     _relationshipService.Delete(x => x.FromType == ObjectType.Asset && x.ToType == ObjectType.Vulnerabilitie && x.FromId == assetId && x.ToId == id);
     _vulnerabilityService.Delete(id);
     return(true);
 }
 public IActionResult Delete(Guid assetId, Guid id)
 {
     _relationshipService.Delete(x => x.FromType == ObjectType.Asset && x.ToType == ObjectType.Treatment && x.FromId == assetId && x.ToId == id);
     return(Ok());
 }
Exemple #5
0
 public bool Delete(Guid assetId, Guid id)
 {
     _relationshipService.Delete(x => x.FromType == ObjectType.Asset && x.ToType == ObjectType.Treatment && x.FromId == assetId && x.ToId == id);
     return(true);
 }