Add et member management middleware
This commit is contained in:
parent
96a9e1c707
commit
514b97c316
13
functions/api/events-team/team-members/_middleware.ts
Normal file
13
functions/api/events-team/team-members/_middleware.ts
Normal file
@ -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();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user