X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_nav%2FskyquakeNav.jsx;h=99d14829244bd57c550c730a5ce0daab44e1ff9b;hp=c4df1e259a15b42b49245a74e2b6566bd39de671;hb=9be8b4847b580cea9e28d2f2a02166753c29b58e;hpb=b584e4b139ec4a30a97ea42ff54c76753731d707 diff --git a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx index c4df1e259..99d148292 100644 --- a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx +++ b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx @@ -28,7 +28,8 @@ import {FormSection} from '../form_controls/formControls.jsx'; import {isRBACValid, SkyquakeRBAC} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; //Temporary, until api server is on same port as webserver -var rw = require('utils/rw.js'); +import rw from 'utils/rw.js'; + var API_SERVER = rw.getSearchParams(window.location).api_server; var UPLOAD_SERVER = rw.getSearchParams(window.location).upload_server; @@ -36,23 +37,6 @@ var UPLOAD_SERVER = rw.getSearchParams(window.location).upload_server; // Internal classes/functions // -class LogoutAppMenuItem extends React.Component { - handleLogout() { - Utils.clearAuthentication(); - } - render() { - return ( -
-

- - Logout - -

-
- ); - } -} - class SelectProject extends React.Component { constructor(props) { super(props); @@ -309,6 +293,7 @@ export function buildNav(nav, currentPlugin, props) { label: nav[k].label || k, route: route }); + let shouldAllow = nav[k].allow || ['*']; if (nav[k].pluginName == currentPlugin) { navClass += " active"; } @@ -316,13 +301,15 @@ export function buildNav(nav, currentPlugin, props) { navItem.priority = nav[k].priority; navItem.order = nav[k].order; if(nav[k].admin_link) { - adminNav.push(( -
  • - {dashboardLink} -
  • - )) + + if (isRBACValid(User, shouldAllow) ){ + adminNav.push(( +
  • + {dashboardLink} +
  • + )) + } } else { - let shouldAllow = nav[k].allow || ['*']; if (isRBACValid(User, shouldAllow) ){ navItem.html = (