fixed iam with exclusive roles (in some cases?) being broken
This commit is contained in:
parent
5d4e730f35
commit
6841c3969a
1 changed files with 6 additions and 2 deletions
|
@ -280,8 +280,12 @@ public sealed class SarAssignerService : IEService, IReadyExecutor
|
||||||
|
|
||||||
if (item.Group.IsExclusive)
|
if (item.Group.IsExclusive)
|
||||||
{
|
{
|
||||||
var rolesToRemove = item.Group.Roles.Select(x => x.RoleId);
|
var rolesToRemove = item.Group.Roles
|
||||||
await item.User.RemoveRolesAsync(rolesToRemove);
|
.Where(x => item.User.RoleIds.Contains(x.RoleId))
|
||||||
|
.Select(x => x.RoleId)
|
||||||
|
.ToArray();
|
||||||
|
if (rolesToRemove.Length > 0)
|
||||||
|
await item.User.RemoveRolesAsync(rolesToRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
await item.User.AddRoleAsync(item.RoleId);
|
await item.User.AddRoleAsync(item.RoleId);
|
||||||
|
|
Loading…
Reference in a new issue