Merge pull request #1233 from madawas/master

Generate nav menu icons based on correct permissions
revert-70aa11f8
Geeth 7 years ago committed by GitHub
commit 23a6dbe524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -605,9 +605,12 @@ var userModule = function () {
if (publicMethods.isAuthorized("/permission/admin/device-mgt/dashboard/view")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/dashboard/view")) {
permissions["VIEW_DASHBOARD"] = true; permissions["VIEW_DASHBOARD"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/platform-configs/view")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/platform-configurations/view")) {
permissions["TENANT_CONFIGURATION"] = true; permissions["TENANT_CONFIGURATION"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/certificates/manage")) {
permissions["CERTIFICATE_MANAGEMENT"] = true;
}
if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/change-status")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/change-status")) {
permissions["CHANGE_DEVICE_STATUS"] = true; permissions["CHANGE_DEVICE_STATUS"] = true;
} }

@ -29,8 +29,6 @@
Device Management Device Management
</a> </a>
</li> </li>
{{/if}}
{{#if permissions.IS_ADMIN}}
<li> <li>
<a href="{{@app.context}}/device-types"> <a href="{{@app.context}}/device-types">
<i class="fw fw-devices"></i> <i class="fw fw-devices"></i>
@ -90,11 +88,11 @@
</ul> </ul>
</li> </li>
{{/if}} {{/if}}
{{#if permissions.LIST_POLICIES}} {{#if permissions.LIST_ALL_POLICIES}}
<li><a href="{{@app.context}}/policies"><i class="fw fw-policy"></i>Policy Management</a></li> <li><a href="{{@app.context}}/policies"><i class="fw fw-policy"></i>Policy Management</a></li>
{{/if}} {{/if}}
{{#if permissions.TENANT_CONFIGURATION}} {{#if configMgtEnabled}}
{{#if isCloud}} {{#if isCloud}}
<li> <li>
@ -109,17 +107,15 @@
<li> <li>
<a><i class="fw fw-settings"></i>Configuration Management</a> <a><i class="fw fw-settings"></i>Configuration Management</a>
<ul> <ul>
<li> {{#if permissions.TENANT_CONFIGURATION}}
<a href="{{@app.context}}/platform-configuration"><i class="fw fw-service"></i> <li><a href="{{@app.context}}/platform-configuration"><i class="fw fw-service"></i>Platform Configurations</a>
Platform Configurations </li>
</a> {{/if}}
</li> {{#if permissions.CERTIFICATE_MANAGEMENT}}
<!-- todo change the permission and get the related permission --> <!-- todo change the permission and get the related permission -->
<li> <li><a href="{{@app.context}}/certificates"><i class="fw fw-security-policy"></i>Certificate Configurations</a>
<a href="{{@app.context}}/certificates"><i class="fw fw-security-policy"></i> </li>
Certificate Configurations {{/if}}
</a>
</li>
{{#if iosPluginFlag}} {{#if iosPluginFlag}}
<li> <li>
<a href="{{@app.context}}/dep/devices"><i class="fw fw-apple"></i> <a href="{{@app.context}}/dep/devices"><i class="fw fw-apple"></i>
@ -138,11 +134,7 @@
<i class="fw fw-map-location"></i> <i class="fw fw-map-location"></i>
Device Locations Device Locations
</a> </a>
</li>
{{/if}} {{/if}}
{{/zone}} {{/zone}}
{{#zone "navbarCollapsableRightItems"}} {{#zone "navbarCollapsableRightItems"}}

@ -34,6 +34,7 @@ function onRequest(context) {
var uiPermissions = userModule.getUIPermissions(); var uiPermissions = userModule.getUIPermissions();
context["permissions"] = uiPermissions; context["permissions"] = uiPermissions;
context["userMgtEnabled"] = (uiPermissions["LIST_USERS"] || uiPermissions["LIST_ROLES"]); context["userMgtEnabled"] = (uiPermissions["LIST_USERS"] || uiPermissions["LIST_ROLES"]);
context["configMgtEnabled"] = (uiPermissions["CERTIFICATE_MANAGEMENT"] || uiPermissions["TENANT_CONFIGURATION"]);
var links = { var links = {
"user-mgt": [], "user-mgt": [],

Loading…
Cancel
Save