mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
fix: fixed iam with exclusive roles (in some cases?) being broken
This commit is contained in:
@@ -280,8 +280,12 @@ public sealed class SarAssignerService : INService, 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);
|
||||||
|
Reference in New Issue
Block a user