Skip to content

Commit

Permalink
1. added ADMIN access to dashboard/sponsor-booth
Browse files Browse the repository at this point in the history
2. added ADMIN access to podium
  • Loading branch information
nicolasmatthewlee committed Oct 10, 2024
1 parent 0ee6816 commit a4e41fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/dashboard/pages/sponsor-booth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const Index = () => {
if (user == null) {
return <>Loading</>;
}
// Limit access to only sponsor role
if (user?.role !== HibiscusRole.SPONSOR) {
// Limit access to only sponsor or admin role
if (![HibiscusRole.SPONSOR, HibiscusRole.ADMIN].includes(user?.role)) {
router.push('/');
return <></>;
}
Expand Down
7 changes: 4 additions & 3 deletions apps/podium/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ const Index = () => {
}, [isSearchOpen]);

const handleSearch = () => {
let searchQuery = (document.getElementById('searchbox') as HTMLInputElement)
.value;
const searchQuery = (
document.getElementById('searchbox') as HTMLInputElement
).value;
setSearchInput(searchQuery);
};

Expand Down Expand Up @@ -311,7 +312,7 @@ const Index = () => {
return <></>;
}

if (user?.role !== HibiscusRole.JUDGE) {
if (![HibiscusRole.JUDGE, HibiscusRole.ADMIN].includes(user?.role)) {
window.location.assign(env.Hibiscus.AppURL.portal);
return <></>;
}
Expand Down

0 comments on commit a4e41fe

Please sign in to comment.