public ActionResult DeleteConfirmed(int id) { var psMetadata = _scriptRepository.GetScriptById(id); if (_scriptIO.Delete(psMetadata.Name)) { _scriptRepository.DeleteScript(id); _scriptRepository.Save(); } return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { var psMetadata = _scriptRepository.GetScriptById(id); if (psMetadata.Category != null && !UserHasAccessToCategory(psMetadata.Category.Id)) { return(RedirectToAction("Index")); } if (_scriptIO.Delete(psMetadata.Name)) { _scriptRepository.DeleteScript(id); _scriptRepository.Save(); } return(RedirectToAction("Index")); }