Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bad permissions check in toggle endpoint
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 8d7e9bd commit 3e01d33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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",
Expand Down

0 comments on commit 3e01d33

Please sign in to comment.