app
components
data
functions
api
admin-apps
appeals
auth
data-transfers
events-team
game-appeals
game-bans
[user]
_middleware.ts
gme
inactivity
infractions
me
mod-queue
reports
uploads
[[path]].ts
events.ts
webview-captcha.ts
_middleware.ts
common.ts
email.ts
gcloud.ts
permissions.ts
roblox-open-cloud.ts
public
.gitignore
.node-version
.prettierignore
OFL.txt
README.md
emotion-server.js
esbuild.config.js
index.css
index.d.ts
package-lock.json
package.json
remix.config.js
server.ts
theme.ts
tsconfig.json
13 lines
367 B
TypeScript
13 lines
367 B
TypeScript
import { jsonError } from "../../common.js";
|
|
|
|
export async function onRequest(context: RequestContext) {
|
|
const { current_user: currentUser } = context.data;
|
|
|
|
if (!currentUser) return jsonError("Not logged in", 401);
|
|
|
|
if (![1 << 5, 1 << 8].find((perm) => currentUser.permissions & perm))
|
|
return jsonError("Forbidden", 403);
|
|
|
|
return await context.next();
|
|
}
|