fix(telegram): fail closed on empty group allowFrom override

This commit is contained in:
Brian Mendonca
2026-02-24 18:30:21 -07:00
committed by Ayaan Zaidi
parent 81752564e9
commit 6bc7544a6a
3 changed files with 84 additions and 0 deletions

View File

@@ -42,6 +42,11 @@ export const evaluateTelegramGroupBaseAccess = (params: {
return { allowed: true };
}
// Explicit per-group/topic allowFrom override must fail closed when empty.
if (!params.effectiveGroupAllow.hasEntries) {
return { allowed: false, reason: "group-override-unauthorized" };
}
const senderId = params.senderId ?? "";
if (params.requireSenderForAllowOverride && !senderId) {
return { allowed: false, reason: "group-override-unauthorized" };