Skip to content
Permalink
Newer
Older
100644 12 lines (8 sloc) 356 Bytes
February 27, 2024 22:55
1
import { jsonError } from "../../../common.js";
2
3
export async function onRequest(context: RequestContext) {
4
const { current_user: user } = context.data;
5
6
if (!user) return jsonError("Not logged in", 401);
7
8
if (![1 << 4, 1 << 12].find((p) => user.permissions & p))
February 27, 2024 22:55
9
return jsonError("Cannot manage strikes", 403);
10
11
return await context.next();
12
}