Adding deviceStatisticsEnabled property to check visibility of device-statistics menu item

revert-dabc3590
dilanua 8 years ago
parent edd400bde4
commit dbeedf246b

@ -7,7 +7,6 @@
"httpsWebURL" : "%https.ip%",
"wssURL" : "%https.ip%",
"wsURL" : "%http.ip%",
"dashboardServerURL" : "%https.ip%",
"enrollmentDir": "/emm-web-agent/enrollment",
"iOSConfigRoot" : "%https.ip%/ios-enrollment/",
"iOSAPIRoot" : "%https.ip%/ios/",
@ -121,5 +120,6 @@
"isOAuthEnabled" : true,
"backendRestEndpoints" : {
"deviceMgt" : "/api/device-mgt/v1.0"
}
},
"deviceStatisticsEnabled" : false
}

@ -28,10 +28,12 @@
System Resources
</a>
</li>
{{#if permissions.VIEW_DASHBOARD}}
<li><a href="{{serverURL}}/portal/t/{{currentUser.domain}}/dashboards/emm-analytics-dashboard/">
<i class="fw fw-bar-chart"></i>Device Statistics</a>
</li>
{{#if dashboardAvailable}}
{{#if permissions.VIEW_DASHBOARD}}
<li><a href="{{serverURL}}/portal/t/{{currentUser.domain}}/dashboards/emm-analytics-dashboard/">
<i class="fw fw-bar-chart"></i>Device Statistics</a>
</li>
{{/if}}
{{/if}}
{{#if permissions.LIST_DEVICES}}
<li>
@ -104,6 +106,7 @@
<ul class="sidebar-messages"></ul>
<br>
<div class="text-center">
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/notification-listing" class="btn-operations btn-default">
<span class="fw-stack">
<i class="fw fw-ring fw-stroke fw-stack-2x"></i>

@ -17,6 +17,10 @@
*/
function onRequest(context) {
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
if (arguments.length < 3) {
throw new Error("Handlebars Helper equal needs 2 parameters");
@ -27,9 +31,7 @@ function onRequest(context) {
return options.fn(this);
}
});
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var links = {
"user-mgt": [],
"role-mgt": [],
@ -40,7 +42,7 @@ function onRequest(context) {
// following viewModel.link value comes here based on the value passed at the point
// where units are attached to a page zone.
// eg: {{unit "appbar" pageLink="users" title="User Management"}}
// eg: {{unit "app-bar" pageLink="users" title="User Management"}}
viewModel["currentActions"] = links[viewModel["pageLink"]];
viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"];
viewModel["currentUser"] = session.get(constants["USER_SESSION_KEY"]);
@ -57,6 +59,8 @@ function onRequest(context) {
permissions["LIST_NOTIFICATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/notifications/view");
permissions["VIEW_DASHBOARD"] = userModule.isAuthorized("/permission/admin/device-mgt/dashboard/view");
viewModel["dashboardAvailable"] = mdmProps["deviceStatisticsEnabled"];
viewModel["permissions"] = permissions;
viewModel["appContext"] = mdmProps["appContext"];
viewModel["serverURL"] = mdmProps["httpsWebURL"];

Loading…
Cancel
Save