app
components
data
functions
api
admin-apps
appeals
auth
data-transfers
events-team
events
points
[id].ts
_middleware.ts
strikes
team-members
game-appeals
game-bans
gme
inactivity
infractions
me
mod-queue
reports
short-links
uploads
[[path]].ts
coconut.ts
events.ts
webview-captcha.ts
_middleware.ts
common.ts
email.ts
gcloud.ts
permissions.ts
roblox-open-cloud.ts
upload.ts
public
.gitignore
.node-version
.prettierignore
OFL.txt
README.md
emotion-server.js
index.css
index.d.ts
package-lock.json
package.json
remix.config.js
server.ts
theme.ts
tsconfig.json
13 lines
373 B
TypeScript
13 lines
373 B
TypeScript
import { jsonError } from "../../../common.js";
|
|
|
|
export async function onRequest(context: RequestContext) {
|
|
const { current_user: user } = context.data;
|
|
|
|
if (!user) return jsonError("You are not logged in", 401);
|
|
|
|
if (![1 << 3, 1 << 4, 1 << 2].find((p) => user.permissions & p))
|
|
return jsonError("Not part of Events Team", 403);
|
|
|
|
return await context.next();
|
|
}
|