From e5eeb78d099ea1456b5907e061f777df814f25b0 Mon Sep 17 00:00:00 2001 From: Madawa Soysa Date: Thu, 15 Mar 2018 19:30:45 +0530 Subject: [PATCH] Generate nav menu icons based on correct permissions This commit fixes the mismatching permissions which are checked while generating navigation menu icons. - Correct the wrong permission string used for configuration management. - Introduce a new UI permission for certificate management. - Move device type link under "owning device permission" which is the permission declared in the JAX-RS implementation. Resolves wso2/product-iots#1782 --- .../app/modules/business-controllers/user.js | 5 +++- .../cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs | 30 +++++++------------ .../cdmf.unit.ui.navbar.nav-menu/nav-menu.js | 1 + 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js index 40a3e7058e..416bb19795 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js @@ -605,9 +605,12 @@ var userModule = function () { if (publicMethods.isAuthorized("/permission/admin/device-mgt/dashboard/view")) { permissions["VIEW_DASHBOARD"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/platform-configs/view")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/platform-configurations/view")) { permissions["TENANT_CONFIGURATION"] = true; } + if (publicMethods.isAuthorized("/permission/admin/device-mgt/certificates/manage")) { + permissions["CERTIFICATE_MANAGEMENT"] = true; + } if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/change-status")) { permissions["CHANGE_DEVICE_STATUS"] = true; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs index 9a1d868dec..b071abf81d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -29,8 +29,6 @@ Device Management - {{/if}} - {{#if permissions.IS_ADMIN}}
  • @@ -90,11 +88,11 @@
  • {{/if}} - {{#if permissions.LIST_POLICIES}} + {{#if permissions.LIST_ALL_POLICIES}}
  • Policy Management
  • {{/if}} - {{#if permissions.TENANT_CONFIGURATION}} + {{#if configMgtEnabled}} {{#if isCloud}}
  • @@ -109,17 +107,15 @@
  • Configuration Management