mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
show infrastructure page to admin users (while hidden for others)
This commit is contained in:
parent
8d1322795c
commit
68a13f738a
2 changed files with 9 additions and 3 deletions
|
@ -121,8 +121,12 @@ class App extends React.Component {
|
|||
{ pages.scenarios ? <Route exact path="/scenarios" component={Scenarios} /> : '' }
|
||||
{ pages.scenarios ? <Route path="/scenarios/:scenario" component={Scenario} /> : '' }
|
||||
{ pages.scenarios ? <Route path="/dashboards/:dashboard" component={Dashboard} /> : '' }
|
||||
{ pages.infrastructure ? <Route exact path="/infrastructure" component={InfrastructureComponents} /> : '' }
|
||||
<Route path="/infrastructure/:ic" component={InfrastructureComponent} />
|
||||
{ currentUser.role === "Admin" || pages.infrastructure ?
|
||||
<Route exact path="/infrastructure" component={InfrastructureComponents} />
|
||||
: '' }
|
||||
{ currentUser.role === "Admin" || pages.infrastructure ?
|
||||
<Route path="/infrastructure/:ic" component={InfrastructureComponent} />
|
||||
: '' }
|
||||
{ pages.account ? <Route path="/account" component={User} /> : '' }
|
||||
<Route path="/users" component={Users} />
|
||||
{ pages.api ? <Route path="/api" component={APIBrowser} /> : '' }
|
||||
|
|
|
@ -101,7 +101,9 @@ class SidebarMenu extends React.Component {
|
|||
: <ul>
|
||||
<li hidden={!values.pages.home}><NavLink to="/home" activeClassName="active" title="Home">Home</NavLink></li>
|
||||
<li hidden={!values.pages.scenarios}><NavLink to="/scenarios" activeClassName="active" title="Scenarios">Scenarios</NavLink></li>
|
||||
<li hidden={!values.pages.infrastructure}><NavLink to="/infrastructure" activeClassName="active" title="Infrastructure">Infrastructure</NavLink></li>
|
||||
{this.props.currentRole === 'Admin' || values.pages.infrastructure ?
|
||||
<li><NavLink to="/infrastructure" activeClassName="active" title="Infrastructure">Infrastructure</NavLink></li> : ''
|
||||
}
|
||||
{this.props.currentRole === 'Admin' ?
|
||||
<li><NavLink to="/users" activeClassName="active" title="Users">Users</NavLink></li> : ''
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue