From 3e01d3391af7bdd0b9dbff861c7b81206e5d8926 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:49:18 -0400 Subject: [PATCH] Fix bad permissions check in toggle endpoint --- functions/api/appeals/toggle.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/api/appeals/toggle.ts b/functions/api/appeals/toggle.ts index 4e0db6e..0bb02a0 100644 --- a/functions/api/appeals/toggle.ts +++ b/functions/api/appeals/toggle.ts @@ -1,8 +1,9 @@ export async function onRequestPost(context: RequestContext) { const { active } = context.data.body; const { permissions } = context.data.current_user; + console.log(permissions) - if (!(permissions & (1 << 0)) || !(permissions & (1 << 11))) + if (!(permissions & (1 << 0)) && !(permissions & (1 << 11))) return new Response('{"error":"Forbidden"}', { headers: { "content-type": "application/json",