Browse Source

Use case-insensitive set ops for role names

pull/24775/head
maliming 8 months ago
parent
commit
a90ac774a9
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

4
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

@ -224,9 +224,9 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe
var operatorOwnRoleSet = (await UserManager.GetRolesAsync(operatorUser)).ToHashSet(StringComparer.OrdinalIgnoreCase);
var inputRoleNameSet = new HashSet<string>(inputRoleNames ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
var keepUnmanageableRoles = targetCurrentRoleSet.Except(operatorOwnRoleSet);
var keepUnmanageableRoles = targetCurrentRoleSet.Except(operatorOwnRoleSet, StringComparer.OrdinalIgnoreCase);
var desiredManageableRoles = inputRoleNameSet.Intersect(operatorOwnRoleSet);
var desiredManageableRoles = inputRoleNameSet.Intersect(operatorOwnRoleSet, StringComparer.OrdinalIgnoreCase);
return keepUnmanageableRoles
.Concat(desiredManageableRoles)

Loading…
Cancel
Save