Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-2006-nonadmin-access-ui (pull request #587)
Browse files Browse the repository at this point in the history
Fixed access to non-admin pages

Approved-by: Dmitriy Kopylenko
Approved-by: Bill Smith
Former-commit-id: de0f8b428780979969cc40b0e3293491b25246ae
  • Loading branch information
rmathis committed Aug 2, 2022
2 parents 335a75c + 47123a6 commit c050260
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
31 changes: 26 additions & 5 deletions ui/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { SessionModal } from './core/user/SessionModal';
import { Roles } from './admin/Roles';
import { Groups } from './admin/Groups';
import { BASE_PATH } from './App.constant';
import { ProtectRoute } from './core/components/ProtectRoute';


function App() {
Expand Down Expand Up @@ -81,12 +82,32 @@ function App() {
</Route>
<Route path="/dashboard" component={Dashboard} />
<Route path="/metadata/source/new" component={NewSource} />
<Route path="/metadata/provider/new" component={NewProvider} />
<Route path="/metadata/attributes" component={Attribute} />
<Route path="/metadata/provider/:id/filter" component={Filter} />
<Route path="/metadata/provider/new" render={() =>
<ProtectRoute redirectTo="/dashboard">
<NewProvider />
</ProtectRoute>
} />
<Route path="/metadata/attributes" render={() =>
<ProtectRoute redirectTo="/dashboard">
<Attribute />
</ProtectRoute>
} />
<Route path="/metadata/provider/:id/filter" render={() =>
<ProtectRoute redirectTo="/dashboard">
<Filter />
</ProtectRoute>
} />
<Route path="/metadata/:type/:id" component={Metadata} />
<Route path="/roles" component={Roles} />
<Route path="/groups" component={Groups} />
<Route path="/roles" render={() =>
<ProtectRoute redirectTo="/dashboard">
<Roles />
</ProtectRoute>
} />
<Route path="/groups" render={() =>
<ProtectRoute redirectTo="/dashboard">
<Groups />
</ProtectRoute>
} />
<Route path="*">
<Redirect to="/dashboard" />
</Route>
Expand Down
3 changes: 3 additions & 0 deletions ui/src/app/dashboard/view/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export function Dashboard () {
<ActionsTab sources={sources} users={users} reloadSources={loadSources} reloadUsers={loadUsers} />
</ProtectRoute>
} />
<Route exact path={`${path}/*`}>
<Redirect to={`${url}/metadata/manager/resolvers`} />
</Route>
</Switch></>
}
</div>
Expand Down

0 comments on commit c050260

Please sign in to comment.