feat: Prevent suspended users performing room changes

Prevents kicks, bans, unbans, and alias modification
This commit is contained in:
nexy7574 2025-06-28 22:42:31 +01:00 committed by Ellis Git
commit 90180916eb
3 changed files with 23 additions and 2 deletions

View file

@ -128,6 +128,9 @@ pub(crate) async fn set_room_visibility_route(
// Return 404 if the room doesn't exist
return Err!(Request(NotFound("Room not found")));
}
if services.users.is_suspended(sender_user).await? {
return Err!(Request(UserSuspended("You cannot perform this action while suspended.")));
}
if services
.users