Fix bad permissions check in toggle endpoint

This commit is contained in:
regalijan 2023-10-19 16:49:18 -04:00
parent 8d7e9bd93d
commit 3e01d3391a
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -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",