Members: demoting an admin derives the flags from the roles left after the removal

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-11 12:16:18 +00:00
commit 030bd0eede

View file

@ -177,6 +177,8 @@ public sealed class IndexModel(
}
else if (!(user.Id == Actor.UserAccount.Id && role == MemberRole.PlatformAdmin))
{
// Out of the collection too, so the flags below derive from the roles as they will stand after the save.
user.Membership.RoleAssignments.Remove(existingAssignment);
dbContext.RoleAssignments.Remove(existingAssignment);
}