Skip to content

Commit 30715a4

Browse files
committed
user right tweak
1 parent bf33d63 commit 30715a4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/client/App.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import useLoggedInUser from './hooks/useLoggedInUser'
99
import { ResultDataProvider } from './contexts/ResultDataContext'
1010
import Footer from './components/Footer'
1111
import NavBar from './components/NavBar/NavBar'
12+
import Unauthorized from './components/Errors/Unauthorized'
1213

1314
const App = () => {
1415
const theme = useTheme()
@@ -22,6 +23,14 @@ const App = () => {
2223
return null
2324
}
2425

26+
if (!user?.iamGroups?.includes('hy-employees')) {
27+
return (
28+
<ThemeProvider theme={theme}>
29+
<Unauthorized />
30+
</ThemeProvider>
31+
)
32+
}
33+
2534
return (
2635
<ThemeProvider theme={theme}>
2736
<SnackbarProvider preventDuplicate>

src/server/routes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ router.use('/questions', questionRouter)
6666
router.use('/results', resultRouter)
6767
router.use('/countries', countryRouter)
6868
router.use('/warnings', warningsRouter)
69+
router.use('/users', userRouter)
6970

7071
router.use(userAccessMiddleware)
7172

72-
router.use('/users', userRouter)
7373
router.use('/entries', entryRouter)
7474
router.use('/organizations', organizationRouter)
7575
router.use('/tuhatprojects', tuhatProjectsRouter)

0 commit comments

Comments
 (0)