From f4294e5efa70743133e3bc2c139d1cb78e82debe Mon Sep 17 00:00:00 2001 From: nelsonad Date: Thu, 12 Nov 2015 14:46:50 -0800 Subject: [PATCH] Case insensitive role existence check --- AspNetIdentity.WebApi/Controllers/AccountsController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AspNetIdentity.WebApi/Controllers/AccountsController.cs b/AspNetIdentity.WebApi/Controllers/AccountsController.cs index 05807c8..712264d 100644 --- a/AspNetIdentity.WebApi/Controllers/AccountsController.cs +++ b/AspNetIdentity.WebApi/Controllers/AccountsController.cs @@ -184,7 +184,7 @@ public async Task AssignRolesToUser([FromUri] string id, [Fro var currentRoles = await this.AppUserManager.GetRolesAsync(appUser.Id); - var rolesNotExists = rolesToAssign.Except(this.AppRoleManager.Roles.Select(x => x.Name)).ToArray(); + var rolesNotExists = rolesToAssign.Except(this.AppRoleManager.Roles.Select(x => x.Name), StringComparer.OrdinalIgnoreCase).ToArray(); if (rolesNotExists.Count() > 0) { @@ -272,4 +272,4 @@ public async Task RemoveClaimsFromUser([FromUri] string id, [ } } -} \ No newline at end of file +}