public ActionResult Delete(int key, int projectId) { if (!CanManageProject(projectId)) { return(JsonNoPermissions()); } ProjectDocumentManager.Delete(key); return(JsonSuccess(null)); }
public ActionResult DeleteDocument(int documentId, int projectId) { if (!CanManageProject(projectId)) { return(JsonNoPermissions()); } var documentDto = ProjectDocumentManager.Get(documentId); if (documentDto != null) { ProjectDocumentManager.Delete(documentId); return(JsonSuccess(new { id = documentId })); } return(JsonError("Unable to find file")); }
public ActionResult DeleteFolder(int folderId, int projectId) { if (!CanManageProject(projectId)) { return(JsonNoPermissions()); } var documentDto = ProjectDocumentManager.Get(folderId); if (documentDto != null) { if (!documentDto.Entity.IsFolder) { throw new ValidationException("Not a folder"); } ProjectDocumentManager.Delete(folderId); return(JsonSuccess(new { id = folderId })); } return(JsonError("Unable to find folder")); }