From 1a9ca2d59e011df1b434fb6d2d1893bb33353662 Mon Sep 17 00:00:00 2001 From: kamidu Date: Tue, 27 Sep 2016 15:41:47 +0530 Subject: [PATCH] Fix for Jira issue: EMM-1635 --- .../permission.hbs | 2 +- .../user-menu.hbs | 164 ++++++++++-------- .../user-menu.js | 12 +- 3 files changed, 106 insertions(+), 72 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/permission.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/permission.hbs index d203e1413e6..63e9d48646b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/permission.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/permission.hbs @@ -72,7 +72,7 @@ - + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs index 1ff652c8c87..eb958f6bfc7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs @@ -15,20 +15,40 @@ specific language governing permissions and limitations under the License. }} +{{#zone "userMenu"}} + {{/zone}} + {{#zone "bottomJs"}} {{js "/js/user-menu.js"}} {{/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.ui.header.user-menu/user-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.js index 39819deacf7..03d61cad531 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.js @@ -16,7 +16,15 @@ * under the License. */ -function onRequest() { +function onRequest(context) { var constants = require("/app/modules/constants.js"); - return session.get(constants["USER_SESSION_KEY"]); + var user = context.user; + var isSuperTenant = false; + if (user.tenantId == -1234){ + isSuperTenant = true; + } + var viewModal = {}; + viewModal.isSuperTenant = isSuperTenant; + viewModal.USER_SESSION_KEY = session.get(constants["USER_SESSION_KEY"]); + return viewModal; }