diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js index 4e7585163a..6244fc1f09 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js @@ -19,8 +19,8 @@ /** * Returns the dynamic state to be populated by add-user page. * - * @param context Object that gets updated with the dynamic state of this page to be presented - * @returns {*} A context object that returns the dynamic state of this page to be presented + * @param viewModel Object that gets updated with the dynamic state of this page to be presented + * @returns {*} A viewModel object that returns the dynamic state of this page to be presented */ function onRequest(context) { // var log = new Log("units/user-create/create.js"); @@ -29,17 +29,17 @@ function onRequest(context) { var response = userModule.getRolesByUserStore(); if (response["status"] == "success") { - context["roles"] = response["content"]; + viewModel["roles"] = response["content"]; } - context["charLimit"] = mdmProps["usernameLength"]; - context["usernameJSRegEx"] = mdmProps["userValidationConfig"]["usernameJSRegEx"]; - context["usernameHelpText"] = mdmProps["userValidationConfig"]["usernameHelpMsg"]; - context["usernameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["usernameRegExViolationErrorMsg"]; - context["firstnameJSRegEx"] = mdmProps["userValidationConfig"]["firstnameJSRegEx"]; - context["firstnameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["firstnameRegExViolationErrorMsg"]; - context["lastnameJSRegEx"] = mdmProps["userValidationConfig"]["lastnameJSRegEx"]; - context["lastnameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["lastnameRegExViolationErrorMsg"]; + viewModel["charLimit"] = mdmProps["usernameLength"]; + viewModel["usernameJSRegEx"] = mdmProps["userValidationConfig"]["usernameJSRegEx"]; + viewModel["usernameHelpText"] = mdmProps["userValidationConfig"]["usernameHelpMsg"]; + viewModel["usernameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["usernameRegExViolationErrorMsg"]; + viewModel["firstnameJSRegEx"] = mdmProps["userValidationConfig"]["firstnameJSRegEx"]; + viewModel["firstnameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["firstnameRegExViolationErrorMsg"]; + viewModel["lastnameJSRegEx"] = mdmProps["userValidationConfig"]["lastnameJSRegEx"]; + viewModel["lastnameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["lastnameRegExViolationErrorMsg"]; - return context; + 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/pages/cdmf.page.certificates/certificates.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.js index 8aeb02353e..a4be059e94 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.js @@ -1,15 +1,16 @@ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; + var viewModel = {}; - context["permissions"] = userModule.getUIPermissions(); - if (userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/certificate/Get")) { - context["removePermitted"] = true; + if (userModule.isAuthorized("/permission/admin/device-mgt/certificates/manage")) { + viewModel["removePermitted"] = true; } - if (userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/certificate/Get")) { - context["viewPermitted"] = true; + if (userModule.isAuthorized("/permission/admin/device-mgt/certificates/view")) { + viewModel["viewPermitted"] = true; } - context["adminUser"] = mdmProps.adminUser; - return context; + + viewModel.adminUser = mdmProps.adminUser; + 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/pages/cdmf.page.policies/policies.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs index 2dcfb0122e..9a3a113791 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs @@ -40,7 +40,7 @@ {{/zone}} {{#zone "navbarActions"}} - {{#if permissions.ADD_ADMIN_POLICY}} + {{#if managePermitted}}
  • @@ -50,8 +50,6 @@ Add Policy
  • - {{/if}} - {{#if permissions.CHANGE_POLICY_PRIORITY}} {{#equal noPolicy false}}
  • @@ -81,7 +79,7 @@

    You don't have any policy at the moment.


    - {{#if permissions.ADD_ADMIN_POLICY}} + {{#if managePermitted}}

    @@ -142,7 +140,7 @@