From 8c265ebf36d4cb532b5cc71cc73cdcb2b61117be Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 26 Mar 2017 12:41:45 -0400 Subject: [PATCH] oink --- Project-Unite/Controllers/AdminController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project-Unite/Controllers/AdminController.cs b/Project-Unite/Controllers/AdminController.cs index 304d526..f5868d5 100644 --- a/Project-Unite/Controllers/AdminController.cs +++ b/Project-Unite/Controllers/AdminController.cs @@ -588,7 +588,7 @@ public ActionResult AddUserToRole(string id = "") public async Task AddUserToRole(AddUserToRoleViewModel model) { var r = db.Roles.FirstOrDefault(role => role.Id == model.RoleId); - var user = db.Users.FirstOrDefault(u => u.DisplayName == model.Username); + var user = db.Users.FirstOrDefault(u => u.Id == model.Username); var uMan = HttpContext.GetOwinContext().GetUserManager(); var isInRole = await uMan.IsInRoleAsync(user.Id, r.Name);