Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Restore data team access to uploads
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 188275a commit 1a7c4a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion functions/api/uploads/_middleware.ts
@@ -1,7 +1,10 @@
export async function onRequest(context: RequestContext) {
const { current_user: currentUser } = context.data;

if (!(currentUser?.permissions & (1 << 5)))
if (
!(currentUser?.permissions & (1 << 5)) ||
!(currentUser?.permissions & (1 << 12))
)
return new Response('{"error":"Forbidden"}', {
headers: {
"content-type": "application/json",
Expand Down
1 change: 1 addition & 0 deletions functions/permissions.ts
Expand Up @@ -31,6 +31,7 @@ export default function (userid: string, roles?: string[]): number {
roles?.includes("338102086095077376")
)
permissions |= 1 << 11; // Head of Discord Moderation
if (roles?.includes("784870326990405672")) permissions |= 1 << 12; // Data Team

return permissions;
}

0 comments on commit 1a7c4a2

Please sign in to comment.