public ActionResult EditPrivilege(int id) { if (User.Identity.IsAuthenticated && User.IsInRole("Admin")) { Privilege privilege = StatementManager.GetPrivilegeById(id); return(View(privilege)); } return(RedirectToAction("Index", "Home")); }
public ActionResult RemovePrivilege(int id) { if (User.Identity.IsAuthenticated && User.IsInRole("Admin")) { return(View(new RemovePrivilegeViewModel { Id = id, Value = StatementManager.GetPrivilegeById(id).Value })); } return(RedirectToAction("Index", "Home")); }
public ActionResult RemovePrivilege(RemovePrivilegeViewModel model) { if (User.Identity.IsAuthenticated && User.IsInRole("Admin")) { if (StatementManager.GetPrivilegeById(model.Id) != null) { StatementManager.RemovePrivilege(model.Id); } return(RedirectToAction("Privileges", "Admin")); } return(RedirectToAction("Index", "Home")); }