Don't allow non-management to access et member management

This commit is contained in:
Regalijan 2024-03-05 21:37:57 -05:00
parent 730e55ebac
commit 2cd5c7a5b7
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520
2 changed files with 6 additions and 8 deletions

View File

@ -37,11 +37,7 @@ export async function loader({ context }: { context: RequestContext }) {
status: 401, status: 401,
}); });
if ( if (![1 << 4, 1 << 12].find((p) => context.data.current_user.permissions & p))
![1 << 3, 1 << 4, 1 << 12].find(
(p) => context.data.current_user.permissions & p,
)
)
throw new Response(null, { throw new Response(null, {
status: 403, status: 403,
}); });

View File

@ -454,9 +454,11 @@ export default function () {
<Link color="#646cff" href="/book-event" mt="16px"> <Link color="#646cff" href="/book-event" mt="16px">
Book an Event Book an Event
</Link> </Link>
<Link color="#646cff" href="/et-members" mb="32px" mt="8px"> {can_approve ? (
Events Team Member Management <Link color="#646cff" href="/et-members" mb="32px" mt="8px">
</Link> Events Team Member Management
</Link>
) : null}
</VStack> </VStack>
</Container> </Container>
); );