From 9925a20964153405f412bc56b56ff8aa183705c9 Mon Sep 17 00:00:00 2001 From: dilanua Date: Sun, 18 Sep 2016 16:31:17 +0530 Subject: [PATCH] Fixing JIRA: https://wso2.org/jira/browse/EMM-1576 --- .../app/pages/mdm.page.dashboard/dashboard.hbs | 11 +++++++++-- .../app/pages/mdm.page.dashboard/dashboard.js | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs index 2026ed97a..8439db378 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs @@ -19,8 +19,8 @@ {{unit "cdmf.unit.lib.qrcode"}} {{unit "mdm.unit.device.qr-modal"}} {{#zone "content"}} +
{{#if permissions.LIST_DEVICES}} -
Devices
@@ -150,8 +150,15 @@
-
{{/if}} + {{# if permissions.PERMITTED_NONE}} +

+ Permitted None +

+
+ You are not authorized to view any of the dashboard listed resources. + {{/if}} + {{/zone}} {{#zone "bottomJs"}} {{js "js/dashboard.js"}} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js index da2c2b46d..9a7fa6c1a 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js @@ -32,6 +32,8 @@ function onRequest() { permissions["ADD_USER"] = userModule.isAuthorized("/permission/admin/device-mgt/users/manage"); permissions["LIST_ROLES"] = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); permissions["ADD_ROLE"] = userModule.isAuthorized("/permission/admin/device-mgt/roles/manage"); + permissions["PERMITTED_NONE"] = !(permissions["LIST_DEVICES"] || permissions["LIST_POLICIES"] || + permissions["LIST_USERS"] || permissions["LIST_ROLES"]); viewModel["permissions"] = permissions; //TODO: Move enrollment URL into app-conf.json