public virtual ActionResult Display(int id, string activity) { var model = Tickets.GetTicket(id); ViewData.Add("Security", Security); if (string.IsNullOrEmpty(activity)) { activity = "ActivityButtons"; } TicketActivity activityEn; if (activity == "invalid" || activity == "ActivityButtons") { activityEn = TicketActivity.NoChange; } else if (activity == "Assign")//assign has different security requirements depending on who ticket is currently assigned to { if (string.IsNullOrEmpty(model.AssignedTo)) { activityEn = TicketActivity.Assign; } else if (model.AssignedTo == Security.CurrentUserName) { activityEn = TicketActivity.Pass; } else { activityEn = TicketActivity.ReAssign; } } else { activityEn = (TicketActivity)Enum.Parse(typeof(TicketActivity), activity); } //TODO: See about a filter for the security check if (!Tickets.CheckSecurityForTicketActivity(model, activityEn)) { // TODO: if this failed, it is probably because something changed to make the requested activity no longer available (ticket state changed), // need to show the error panel if (IsItReallyRedirectFromAjax()) { TempData["IsRedirectFromAjax"] = IsItReallyRedirectFromAjax(); return(RedirectToAction(MVC.TicketEditor.Display(id, string.Empty))); } } SetupActivityViewData(activity, model); if (IsItReallyRedirectFromAjax()) { return(PartialView(string.Format("~/Views/TicketEditor/Controls/{0}.ascx", activity), model)); } return(View(model)); }