Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow data team to access user history
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 88c317c commit 98ef2ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions functions/api/game-bans/[user]/revoke.ts
Expand Up @@ -3,6 +3,9 @@ import { insertLogs } from "../../../gcloud.js";
import { jsonError } from "../../../common.js";

export async function onRequestPost(context: RequestContext) {
if (!(context.data.current_user.permissions & (1 << 5)))
return jsonError("Forbidden", 403);

const { ticket_link } = context.data.body;

if (
Expand Down
3 changes: 2 additions & 1 deletion functions/api/game-bans/_middleware.ts
Expand Up @@ -5,7 +5,8 @@ export async function onRequest(context: RequestContext) {

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();
}

0 comments on commit 98ef2ed

Please sign in to comment.