From cfa32cf75c0651b8dac12703d929b8ca4ebbdfa3 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Sep 2016 11:10:01 +0530 Subject: [PATCH 1/6] Fixing icons background color issue --- .../devicemgt/app/units/cdmf.unit.ui.theme/theme.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/theme.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/theme.hbs index cc4c1e741d8..bd79e7563f6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/theme.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/theme.hbs @@ -18,7 +18,7 @@ {{#zone "topCss" override=false}} {{css "css/custom-theme.css"}} {{css "css/custom-common.css"}} - {{css "css/custom-desktop.css"}} + {{css "css/custom-desktop.css" combine=false}} {{css "css/docs.min.css"}} {{css "css/modal.css"}} {{/zone}} From 432c46601b3d70194950ae03e295c2c858aedb89 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Sep 2016 11:12:08 +0530 Subject: [PATCH 2/6] Fixing breadcrumb height issue --- .../app/units/uuf.unit.theme/public/css/theme-wso2.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css index 7d570d33e02..39d6f1b6caf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css @@ -4431,7 +4431,7 @@ a.thumbnail.active { .thumbnail.icon { border: none; margin: 0; - background: #004675; + background: #11375b; color: #fff; text-align: center; overflow: hidden; From 2cd5a0e65947e01ccb5fc4b0908f58f4f208afc0 Mon Sep 17 00:00:00 2001 From: kamidu Date: Fri, 9 Sep 2016 11:13:37 +0530 Subject: [PATCH 3/6] Enable permission check according to the new permissions --- .../app/pages/cdmf.page.policies/policies.js | 2 +- .../cdmf.page.policy.priority/priority.hbs | 11 +- .../cdmf.page.policy.priority/priority.js | 3 + .../units/cdmf.unit.policy.create/create.hbs | 115 +++--- .../units/cdmf.unit.policy.create/create.js | 2 + .../app/units/cdmf.unit.policy.edit/edit.hbs | 377 ++++++++++-------- .../app/units/cdmf.unit.policy.edit/edit.js | 8 +- .../app/units/cdmf.unit.policy.view/view.hbs | 138 ++++--- .../app/units/cdmf.unit.policy.view/view.js | 1 + 9 files changed, 362 insertions(+), 295 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js index 884627e70e0..a41d4cc69a4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js @@ -56,7 +56,7 @@ function onRequest(context) { page["noPolicy"] = true; } - if (userModule.isAuthorized("/permission/admin/device-mgt/policies/delete")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/policies/manage")) { page.managePermitted = true; } return page; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.hbs index 7b1a0775fe6..e526b7eaf4a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.hbs @@ -38,5 +38,14 @@ {{/zone}} {{#zone "content"}} - {{unit "cdmf.unit.policy.priority"}} + {{#if isAuthorized}} + {{unit "cdmf.unit.policy.priority"}} + {{else}} +

+ Permission Denied +

+
+ You not authorized to enter Policy Management Section. +
+ {{/if}} {{/zone}} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.js index ccc71cc1504..76f53e8024e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.js @@ -26,4 +26,7 @@ function onRequest(context){ return options.fn(this); } }); + var viewModel = {}; + viewModel.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage"); + return viewModel; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs index adfadb50ab4..6ca4a632859 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs @@ -16,70 +16,79 @@ under the License. }} {{#zone "content"}} -
-
-
-
-

ADD POLICY

-
-
-
-
-
1
- + {{#if isAuthorized}} +
+
+
+
+

ADD POLICY

+
+
+
+
+
1
+ +
+
-
-
-
-
-
2
- +
+
+
2
+ +
+
-
-
-
-
-
3
- +
+
+
3
+ +
+
-
-
-
-
-
4
- +
+
+
4
+ +
+
-
-
-
-
-
-

Step 1: Select a platform

-
+
+
+
+

Step 1: Select a platform

+
-
-
- +
+
+ +
+
-
-
+ {{else}} +

+ Permission Denied +

+
+ You not authorized to enter Policy Management Section. +
+ {{/if}} {{/zone}} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js index 79d41eab855..3f6da524773 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js @@ -24,6 +24,8 @@ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var types = {}; + + types.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage"); types["types"] = []; var typesListResponse = deviceModule.getDeviceTypes(); if (typesListResponse["status"] == "success") { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs index fbeb8f8eb30..f053c7beeae 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs @@ -1,222 +1,255 @@ {{#zone "content"}} -
-
+ {{#if isAuthorized }} +
+
-