From cfdc10f159c19b3f1bb0ec2c6a478c52ca09cba1 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 30 Jan 2024 23:58:39 +0200 Subject: [PATCH] Fix author not having tournament perms --- app/features/tournament-bracket/core/Tournament.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/features/tournament-bracket/core/Tournament.ts b/app/features/tournament-bracket/core/Tournament.ts index 4e76259f7..f8fa2572a 100644 --- a/app/features/tournament-bracket/core/Tournament.ts +++ b/app/features/tournament-bracket/core/Tournament.ts @@ -587,6 +587,8 @@ export class Tournament { if (!user) return false; if (isAdmin(user)) return true; + if (this.ctx.author.id === user.id) return true; + return this.ctx.staff.some( (staff) => staff.id === user.id && staff.role === "ORGANIZER", ); @@ -596,6 +598,8 @@ export class Tournament { if (!user) return false; if (isAdmin(user)) return true; + if (this.ctx.author.id === user.id) return true; + return this.ctx.staff.some( (staff) => staff.id === user.id && ["ORGANIZER", "STREAMER"].includes(staff.role),