Allow data team to access user history
This commit is contained in:
parent
88c317c5db
commit
98ef2ede43
@ -3,6 +3,9 @@ import { insertLogs } from "../../../gcloud.js";
|
|||||||
import { jsonError } from "../../../common.js";
|
import { jsonError } from "../../../common.js";
|
||||||
|
|
||||||
export async function onRequestPost(context: RequestContext) {
|
export async function onRequestPost(context: RequestContext) {
|
||||||
|
if (!(context.data.current_user.permissions & (1 << 5)))
|
||||||
|
return jsonError("Forbidden", 403);
|
||||||
|
|
||||||
const { ticket_link } = context.data.body;
|
const { ticket_link } = context.data.body;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -5,7 +5,8 @@ export async function onRequest(context: RequestContext) {
|
|||||||
|
|
||||||
if (!currentUser) return jsonError("Not logged in", 401);
|
if (!currentUser) return jsonError("Not logged in", 401);
|
||||||
|
|
||||||
if (!(currentUser.permissions & (1 << 5))) return jsonError("Forbidden", 403);
|
if (![1 << 5, 1 << 8].find((perm) => currentUser.permissions & perm))
|
||||||
|
return jsonError("Forbidden", 403);
|
||||||
|
|
||||||
return await context.next();
|
return await context.next();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user