Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't allow non-management to access et member management
  • Loading branch information
regalijan committed Mar 6, 2024
1 parent 730e55e commit 2cd5c7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 1 addition & 5 deletions app/routes/et-members.tsx
Expand Up @@ -37,11 +37,7 @@ export async function loader({ context }: { context: RequestContext }) {
status: 401,
});

if (
![1 << 3, 1 << 4, 1 << 12].find(
(p) => context.data.current_user.permissions & p,
)
)
if (![1 << 4, 1 << 12].find((p) => context.data.current_user.permissions & p))
throw new Response(null, {
status: 403,
});
Expand Down
8 changes: 5 additions & 3 deletions app/routes/events-team.tsx
Expand Up @@ -454,9 +454,11 @@ export default function () {
<Link color="#646cff" href="/book-event" mt="16px">
Book an Event
</Link>
<Link color="#646cff" href="/et-members" mb="32px" mt="8px">
Events Team Member Management
</Link>
{can_approve ? (
<Link color="#646cff" href="/et-members" mb="32px" mt="8px">
Events Team Member Management
</Link>
) : null}
</VStack>
</Container>
);
Expand Down

0 comments on commit 2cd5c7a

Please sign in to comment.