Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add et member management middleware
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 96a9e1c commit 514b97c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions functions/api/events-team/team-members/_middleware.ts
@@ -0,0 +1,13 @@
export async function onRequest(context: RequestContext) {
if (
![1 << 4, 1 << 12].find((p) => context.data.current_user?.permissions & p)
)
return new Response('{"error":"Forbidden"}', {
headers: {
"content-type": "application/json",
},
status: 403,
});

return await context.next();
}

0 comments on commit 514b97c

Please sign in to comment.