public ActionResult Delete(UserHostSearchDelete value) { if (value == null) { throw new ArgumentNullException("value"); } var search = UserHostSearchService.GetById(value.Id); if (search == null) { return base.HttpNotFound(); } var privilege = new UserHostSearchPrivilege(); if (!privilege.CanDelete(search)) { return NotAuthorized(); } this.UserHostSearchService.Delete(search); return base.RedirectToRoute(UsersAdministrationRoutes.HostSearchCreate); }
public ActionResult Delete(int id) { var search = this.UserHostSearchService.GetById(id); if (search == null) { return HttpNotFound(); } var privilege = new UserHostSearchPrivilege(); return privilege.CanDelete(search) ? base.View(Views.Delete, new UserHostSearchDelete(search)) : NotAuthorized(); }