diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js index c1acb8e9f26..fa2eaffb6ea 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js @@ -150,6 +150,8 @@ function loadRoles() { var innerhtml = ''; + var isAdminRole = $("#role-table").data("role") === data.name; + var editLink = '
'; - if (!isCloud) { + if (!isCloud && !isAdminRole) { innerhtml = editLink + editPermissionLink + removeLink; } return innerhtml; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js index 997711701c1..f16ea8db7c5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js @@ -18,8 +18,6 @@ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; - var username = request.getParameter("username"); - var user = userModule.getUser(username)["content"]; var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var isExsistingUser = false; var userName = request.getParameter("username"); @@ -49,7 +47,8 @@ function onRequest(context) { } var canEdit = false; - if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit") && + userName !== deviceMgtProps['adminUser'].split("@")[0]) { canEdit = true; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.hbs index 76fc1167765..428f1b84143 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.hbs @@ -19,68 +19,80 @@Edit Role
-Please note that * sign represents required fields of data.
-Attention!
+Edit Role
+Please note that * sign represents required fields of data.
+