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 76fc116776..428f1b8414 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.

-
-
-
- - -
- -
- -
- - {{#if isCloud}} -
- - devicemgt - - - {{else}} -
- - {{/if}} + {{#if isAdminRole}} +
+
+

Attention!

+
+
This is an prohibited action. +
+
+ {{else}} +
+
+

Edit Role

+

Please note that * sign represents required fields of data.

+
+
+
+ + +
+ +
+ +
+ + {{#if isCloud}} +
+ + devicemgt + +
+ {{else}} +
+ +
+ {{/if}} + minimum 3 characters long and do not + include any whitespaces. + +
+ + + + +
-
-
- -
-
- - - -
+ {{/if}}
- - {{#zone "bottomJs"}} - {{js "js/bottomJs.js"}} - {{/zone}} +
+ +{{#zone "bottomJs"}} + {{js "js/bottomJs.js"}} +{{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.js index d5c363ef1f..86ff656737 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit/edit.js @@ -31,6 +31,8 @@ function onRequest(context) { var userStore; context.isCloud = deviceMgtProps.isCloud; + var isAdminRole = deviceMgtProps["adminRole"] === roleName; + if (roleName) { if (roleName.indexOf("/") > -1) { userStore = roleName.substr(0, roleName.indexOf("/")); @@ -41,6 +43,7 @@ function onRequest(context) { if (response["status"] == "success") { context["role"] = response["content"]; } + context["isAdminRole"] = isAdminRole; context["userStore"] = userStore; context["roleNameJSRegEx"] = deviceMgtProps["roleValidationConfig"]["roleNameJSRegEx"]; context["roleNameHelpText"] = deviceMgtProps["roleValidationConfig"]["roleNameHelpMsg"];