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:
parent
1571bf3e32
commit
030bd0eede
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue