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 0bf54e2c2..fbc3f2753 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,15 +19,15 @@ {{unit "cdmf.unit.lib.qrcode"}} {{unit "mdm.unit.device.qr-modal"}} {{#zone "content"}} - {{#if permissions.LIST_DEVICES}} -
-
-
-
Devices
-
-
-
- Loading... + {{#if permissions.LIST_DEVICES}} +
+ - {{/if}} - {{# if permissions.LIST_POLICIES}} -
-
-
Policies
-
-
-
- Loading... +
+ {{/if}} + {{# if permissions.LIST_POLICIES}} +
+
+
Policies
+
+
+
+ Loading... @@ -78,19 +80,19 @@ {{/if}} -
- {{/if}} - {{# if permissions.LIST_USERS}} -
-
-
Users
-
-
-
- Loading... +
+ {{/if}} + {{# if permissions.LIST_USERS}} +
+
+
Users
+
+
+
+ Loading... @@ -111,19 +113,19 @@ {{/if}} -
- {{/if}} - {{# if permissions.LIST_ROLES}} -
-
-
Roles
-
-
-
- Loading... +
+ {{/if}} + {{# if permissions.LIST_ROLES}} +
+
+
Roles
+
+
+
+ Loading... @@ -144,12 +146,12 @@ {{/if}} -
- {{/if}} +
+ {{/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 a6c495532..e1480d31c 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 @@ -29,6 +29,9 @@ function onRequest(context) { permissions.ADD_POLICY = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage"); permissions.ADD_ROLE = userModule.isAuthorized("/permission/admin/device-mgt/roles/manage"); permissions.ADD_USER = userModule.isAuthorized("/permission/admin/device-mgt/users/manage"); + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/ios") | userModule.isAuthorized("/permission/admin/devices/enroll/android") | userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/windows") ){ + permissions.ENROLL_DEVICE = true; + } viewModel.permissions = permissions; //TODO: Move enrollment URL into app-conf.json viewModel.enrollmentURL = mdmProps.generalConfig.host + mdmProps.enrollmentDir; 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.device.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js index cc3d8d962..a3186092a 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js @@ -110,7 +110,7 @@ function loadOperationBar(deviceType) { var successCallback = function (data) { var permittedOperations = []; var i; - var permissionList = JSON.parse($("#operations-mod").data("permissions")); + var permissionList = $("#operations-mod").data("permissions"); var totalFeatures = JSON.parse(data); for (i = 0; i < permissionList[deviceType].length; i++) { var j;