Skip to content

Commit

Permalink
front: use RoleBasedRoute to check role access to stdcm
Browse files Browse the repository at this point in the history
  • Loading branch information
kmer2016 committed Jun 27, 2024
1 parent 964ed37 commit d0659bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion front/src/main/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import NotificationsState from 'common/Notifications';
import { OsrdContextLayout } from 'common/osrdContext';
import { MODES } from 'main/consts';
import Home from 'main/home';
import RoleBasedRoute from 'modules/authorization/components/RoleBasedRoute';
import Error403 from 'modules/authorization/Error403';
import { editorSlice } from 'reducers/editor';
import editorSelectors from 'reducers/editor/selectors';
import { updateLastInterfaceVersion } from 'reducers/main';
Expand Down Expand Up @@ -67,7 +69,11 @@ const router = createBrowserRouter([
children: [
{
path: '*',
element: <HomeStdcm />,
element: (
<RoleBasedRoute roles={[]}>
<HomeStdcm />
</RoleBasedRoute>
),
},
],
},
Expand Down Expand Up @@ -104,6 +110,10 @@ const router = createBrowserRouter([
},
],
},
{
path: '403/*',
element: <Error403 />,
},
{
path: '*',
element: <ErrorBoundary />,
Expand Down

0 comments on commit d0659bf

Please sign in to comment.