fix(chat): platform admin cannot moderate chats

This commit is contained in:
2026-02-24 21:21:22 +01:00
parent 1bbe4fdc0a
commit cf4cc77071

View File

@@ -398,7 +398,8 @@ app.get(
const isModerator = Boolean(
chatUser &&
(chatUser.channelRole === 'owner' ||
(chatUser.isPlatformAdmin ||
chatUser.channelRole === 'owner' ||
chatUser.channelRole === 'manager' ||
chatUser.channelRole === 'chatModerator' ||
chatUser.channelRole === 'botModerator')
@@ -501,6 +502,13 @@ app.get(
!socketState.targetUsername ||
!socketState.channelId
) {
socket.send(
JSON.stringify({
type: 'moderationError',
code: 'FORBIDDEN',
message: 'You do not have permission to moderate this chat.',
})
);
return;
}
@@ -553,6 +561,13 @@ app.get(
!socketState.targetUsername ||
!socketState.channelId
) {
socket.send(
JSON.stringify({
type: 'moderationError',
code: 'FORBIDDEN',
message: 'You do not have permission to moderate this chat.',
})
);
return;
}