Merge pull request #710 from rasika/master

Fixing Policy view and policy edit doesn't honor isCloud param
revert-70aa11f8
Harshan Liyanage 8 years ago committed by GitHub
commit b9691988a9

@ -1,7 +1,7 @@
{{#zone "content"}}
{{#if isAuthorized}}
<span id="logged-in-user" class="hidden" data-username="{{user.username}}" data-domain="{{user.domain}}"
data-tenant-id="{{user.tenantId}}" data-iscloud="{{isCloud}}"></span>
<span id="logged-in-user" class="hidden" data-username="{{@user.username}}" data-domain="{{@user.domain}}"
data-tenant-id="{{@user.tenantId}}" data-iscloud="{{isCloud}}"></span>
<div class="row">
<div class="col-md-12">

@ -67,8 +67,6 @@ function onRequest(context) {
}
}
var user = userModule.getCarbonUser();
types["user"] = {username: user.username, domain: user.domain, tenantId: user.tenantId};
var roles = userModule.getRoles();
if (roles["status"] == "success") {
types["roles"] = roles["content"];

@ -1,7 +1,7 @@
{{#zone "content"}}
{{#if isAuthorized }}
<span id="logged-in-user" class="hidden" data-username="{{user.username}}" data-domain="{{user.domain}}"
data-tenant-id="{{user.tenantId}}"></span>
<span id="logged-in-user" class="hidden" data-username="{{@user.username}}" data-domain="{{@user.domain}}"
data-tenant-id="{{@user.tenantId}}" data-iscloud="{{isCloud}}"></span>
<span id="policy-operations" class="hidden" data-template="{{policyOperations.template}}"
data-script="{{policyOperations.script}}" data-style="{{policyOperations.style}}"></span>
<div class="row">

@ -60,5 +60,8 @@ function onRequest(context) {
context.isAuthorizedViewRoles = userModule.isAuthorized("/permission/admin/device-mgt/users/view");
context.isAuthorizedViewGroups = userModule.isAuthorized("/permission/admin/device-mgt/groups/view");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
context["isCloud"] = devicemgtProps.isCloud;
return context;
}

@ -196,7 +196,7 @@ skipStep["policy-platform"] = function (policyPayloadObj) {
hasPolicyProfileScript = false;
}
$.template(policyEditTemplateCacheKey, context + policyEditTemplateSrc, function (template) {
var content = template();
var content = template({"iscloud" : $("#logged-in-user").data("iscloud")});
$("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden");
if (hasPolicyProfileScript) {

@ -84,7 +84,7 @@ var displayPolicy = function (policyPayloadObj) {
hasPolicyProfileScript = false;
}
$.template(policyViewTemplateCacheKey, context + policyViewTemplateSrc, function (template) {
var content = template();
var content = template({"iscloud" : $("#logged-in-user").data("iscloud")});
$("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden");
if (hasPolicyProfileScript) {

@ -1,5 +1,7 @@
{{#zone "content"}}
{{#if isAuthorized}}
<span id="logged-in-user" class="hidden" data-username="{{@user.username}}" data-domain="{{@user.domain}}"
data-tenant-id="{{@user.tenantId}}" data-iscloud="{{isCloud}}"></span>
{{#defineZone "policy-profile-top"}}
<div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar">

@ -39,5 +39,9 @@ function onRequest(context) {
}
}
page.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/view");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
page["isCloud"] = devicemgtProps.isCloud;
return page;
}
Loading…
Cancel
Save