public ActionResult AddUserToRule() { var model = new AddUserToRule(); model.roles.Add("User"); model.roles.Add("Administrator"); return(View(model)); }
public ActionResult AddUserToRule(AddUserToRule model) { try { var user = UserManager.FindByEmail(model.Email); UserManager.AddToRole(user.Id, model.selectedRole); return(RedirectToAction("Index", "Locations")); } catch (Exception) { return(HttpNotFound()); } }