public ActionResult Edit(EditUserViewModel model, string id) { if (User.Identity.IsAuthenticated && ((User.IsInRole("User") && id == User.Identity.GetUserId()) || User.IsInRole("Admin"))) { if (!ModelState.IsValid) { return(View(model)); } try { SiteUserManager.EditSiteUser(model, id, Server); } catch (Exception) { } return(RedirectToAction("UserProfile", "User", new { id })); } return(RedirectToAction("Index", "Home")); }