From 42a5493a89a743c66118856a91c1fe95fbd232bd Mon Sep 17 00:00:00 2001 From: dilanua Date: Sun, 18 Sep 2016 17:02:12 +0530 Subject: [PATCH] Fixing JIRA: https://wso2.org/jira/browse/EMM-1577 --- .../mdm.unit.ui.navbar.nav-menu/nav-menu.hbs | 73 +++++++++++-------- .../mdm.unit.ui.navbar.nav-menu/nav-menu.js | 22 +++--- .../public/js/jquery.qrcode.min.js | 0 3 files changed, 55 insertions(+), 40 deletions(-) mode change 100755 => 100644 components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/jquery.qrcode.min.js diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs index 9d24059a25..1e9135d6b1 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -22,15 +22,16 @@ {{/zone}} {{#zone "navMenu-items"}} -
  • - - - Admin Dashboard - -
  • +
  • + + + Resource Dashboard + +
  • {{#if permissions.LIST_DEVICES}}
  • + Device Management @@ -38,33 +39,41 @@
  • {{/if}} -
  • User Management - -
  • + {{#if permissions.USER_MGT_PERMITTED}} +
  • User Management + +
  • + {{/if}} {{#if permissions.LIST_POLICIES}} -
  • Policy Management
  • +
  • + Policy Management
  • + {{/if}} + {{#if permissions.CONFIG_MGT_PERMITTED}} +
  • Configuration Management + +
  • {{/if}} -
  • Configuration Management - -
  • {{/zone}} {{#zone "navbarCollapsableRightItems"}} @@ -83,6 +92,7 @@ {{/zone}} {{#zone "sidePanes"}} + {{/zone}} {{#zone "bottomJs"}} + diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js index 6111547e50..cfb664ad57 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js @@ -43,16 +43,20 @@ function onRequest(context) { // eg: {{unit "appbar" pageLink="users" title="User Management"}} viewModel["currentActions"] = links[viewModel["pageLink"]]; viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"]; - var currentUser = session.get(constants["USER_SESSION_KEY"]); + viewModel["currentUser"] = session.get(constants["USER_SESSION_KEY"]); + var permissions = {}; - permissions.LIST_DEVICES = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view"); - permissions.LIST_POLICIES = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); - permissions.LIST_ROLES = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); - permissions.LIST_USERS = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); - permissions.LIST_NOTIFICATIONS = userModule.isAuthorized("/permission/admin/device-mgt/notifications/view"); - permissions.LIST_CONFIGURATION = userModule.isAuthorized("/permission/admin/device-mgt/platform-configurations/view"); - viewModel.permissions = permissions; - viewModel["currentUser"] = currentUser; + permissions["LIST_DEVICES"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view"); + permissions["LIST_POLICIES"] = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); + permissions["LIST_USERS"] = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); + permissions["LIST_ROLES"] = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); + permissions["USER_MGT_PERMITTED"] = (permissions["LIST_USERS"] || permissions["LIST_ROLES"]); + permissions["LIST_PLATFORM_CONFIGURATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/platform-configurations/view"); + permissions["LIST_CERTIFICATES"] = userModule.isAuthorized("/permission/admin/device-mgt/certificates/view"); + permissions["CONFIG_MGT_PERMITTED"] = (permissions["LIST_PLATFORM_CONFIGURATIONS"] || permissions["LIST_CERTIFICATES"]); + permissions["LIST_NOTIFICATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/notifications/view"); + + viewModel["permissions"] = permissions; viewModel["appContext"] = mdmProps["appContext"]; return viewModel; diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/jquery.qrcode.min.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/jquery.qrcode.min.js old mode 100755 new mode 100644