From a9d00964d2811db35e91d30db1ff9d254bd2dba1 Mon Sep 17 00:00:00 2001
From: dilanua
+ Permission Denied
+
+
+ You are not authorized to view any enrolled device in the system.
+ {{/if}}
{{/zone}}
\ No newline at end of file
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.device.view/view.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js
index 21ce99302..1f7e9c088 100644
--- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js
@@ -17,17 +17,24 @@
*/
function onRequest(context){
- var utility = require("/app/modules/utility.js").utility;
- context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
- if (arguments.length < 3)
- throw new Error("Handlebars Helper equal needs 2 parameters");
- if( lvalue!=rvalue ) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
+ var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
+ var viewModel = {};
- var deviceType = context.uriParams.deviceType;
- return {"deviceViewUnitName": utility.getTenantedDeviceUnitName(deviceType, "device-view")};
+ // permission checks
+ // [1] checking viewing devices permission
+ viewModel["isAuthorized"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view");
+
+ if (viewModel["isAuthorized"]) {
+ context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
+ if (arguments.length < 3)
+ throw new Error("Handlebars Helper equal needs 2 parameters");
+ if( lvalue!=rvalue ) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+ });
+ }
+
+ return viewModel;
}
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.devices/devices.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs
index 0c5652957..b56d066f1 100644
--- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs
@@ -156,6 +156,12 @@
No applications found. " + - "please try refreshing the list in a while.
Operation Code | -Status | -Request created at | -
---|
InE>
z+BF38pKLP0#54rB%~+Uzz;2Zyz@!02Xm|^g9k3EXiixU}H&*J&FtveDh-ol&0A$I4
z3ACWdbVf{|!$S@;VdCSVS7nX^Q=b5>D=vb$3)tfkLm~98el9&J8;MH5NYKr$=0wC3
z5K<@1(vu_XB{2&Tyb_q>Xe0QNnE#Z~eJRXcV6y+nVlDvayFBJcU_tE^G1CAVfimVl
z1(ihw6AuWUU-e&_sv0ILk#3U4S{?JB^r_LnR0e1eEldRfsXoP20(6tL|CRf#b3?n)
zeV~ge4j_9yOjJvMLu-AGnGd9Z%}Y!pRy3_Q9J7K8Jq7SuOizGzK7&atho%uSVO{Z|
z5s@~Q1Q5OYGpsnEA6ziODg#i06;=h%Eh;!;B>=P;A1qHGZJvi?1p#O-0ZR)&0-0D&
z04gZNdP9JYg$9Ym1Vek1?7+gsL!&1HSYQCDPhf%Y&==J+K33-vTnvm7gr+kV4`Npt
z#Di>D#LC7+7uu41!&r8F3=DRBgkw6C4iSHkkP`WE6YCL>xhuz5>44)f2zE4pD2T8>
z0H}fny9x-#f)!f}2&Pd0`+yl8V3i)W)jw^o9rhy7_ClkuojA~3&syv~5_HgZJ=j;|
zX!K?l8 )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