From: Laurence Maultsby Date: Wed, 12 Apr 2017 19:23:16 +0000 (-0400) Subject: Admin: project and user management hide/show based on role X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=027dcf27274b717a71fc23034c35089d310ada65;p=osm%2FUI.git Admin: project and user management hide/show based on role Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx index c4df1e259..f9161cc5d 100644 --- a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx +++ b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx @@ -309,6 +309,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 +317,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 = (
    diff --git a/skyquake/plugins/project_management/config.json b/skyquake/plugins/project_management/config.json index 642fb907d..34537c650 100644 --- a/skyquake/plugins/project_management/config.json +++ b/skyquake/plugins/project_management/config.json @@ -5,6 +5,7 @@ "order": 1, "priority":2, "admin_link": true, + "allow": ["rw-rbac-platform:super-admin", "rw-rbac-platform:platform-admin", "rw-rbac-platform:platform-oper", "rw-project:project-admin", "rw-project:project-oper"], "routes": [ { "label": "Project Management Dashboard",