Files
dsh-telegram-channel/src/auth.ts
T
2026-08-14 16:04:38 +08:00

10 lines
258 B
TypeScript

export function isAuthorized(opts: {
allowAllUsers: boolean
allowedUserIds: number[]
userId?: number
}): boolean {
if (opts.allowAllUsers) return true
if (opts.userId === undefined) return false
return opts.allowedUserIds.includes(opts.userId)
}