Don't allow standard et to access strike api routes
This commit is contained in:
parent
2f200f889a
commit
cae9af5359
@ -5,13 +5,7 @@ export async function onRequest(context: RequestContext) {
|
||||
|
||||
if (!user) return jsonError("Not logged in", 401);
|
||||
|
||||
if (![1 << 3, 1 << 4, 1 << 12].find((p) => user.permissions & p))
|
||||
return jsonError("Not part of Events Team", 403);
|
||||
|
||||
if (
|
||||
context.request.method !== "GET" &&
|
||||
![1 << 4, 1 << 12].find((p) => user.permissions & p)
|
||||
)
|
||||
if (![1 << 4, 1 << 12].find((p) => user.permissions & p))
|
||||
return jsonError("Cannot manage strikes", 403);
|
||||
|
||||
return await context.next();
|
||||
|
Loading…
x
Reference in New Issue
Block a user