Fixing permissions for [devicemgt-user] and [devicemgt-admin] roles

revert-70aa11f8
Rasika Perera 8 years ago
parent 857df46edf
commit 2206e258d1

@ -29,13 +29,15 @@ var carbonServer = new carbonModule.server.Server({
application.put("carbonServer", carbonServer); application.put("carbonServer", carbonServer);
var permissions = { var permissions = {
"/permission/admin/device-mgt/devices/enroll": ["ui.execute"], "/permission/admin/Login": ["ui.execute"]
"/permission/admin/device-mgt/devices/disenroll": ["ui.execute"],
"/permission/admin/device-mgt/devices/owning-device": ["ui.execute"],
"/permission/admin/device-mgt/groups": ["ui.execute"],
"/permission/admin/device-mgt/notifications": ["ui.execute"],
"/permission/admin/device-mgt/policies": ["ui.execute"],
"/permission/admin/manage/api/subscribe": ["ui.execute"]
}; };
var adminPermissions = {
"/permission/admin": ["ui.execute"]
};
//On Startup, admin user will get both roles: devicemgt-admin and devicemgt-user
//Average user through sign-up will only receive the role: devicemgt-user.
//Admin can setup necessary permissions for the role: devicemgt-user
userModule.addRole("internal/devicemgt-user", ["admin"], permissions); userModule.addRole("internal/devicemgt-user", ["admin"], permissions);
userModule.addRole("internal/devicemgt-admin", ["admin"], adminPermissions);

@ -45,6 +45,7 @@
</a> </a>
</li> </li>
{{/if}} {{/if}}
{{#if userMgtEnabled}}
<li><a><i class="fw fw-user"></i>User Management</a> <li><a><i class="fw fw-user"></i>User Management</a>
<ul> <ul>
{{#if permissions.LIST_USERS}} {{#if permissions.LIST_USERS}}
@ -56,22 +57,21 @@
{{/if}} {{/if}}
</ul> </ul>
</li> </li>
{{/if}}
{{#if permissions.LIST_POLICIES}} {{#if permissions.LIST_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}}
<li><a><i class="fw fw-settings"></i>Configuration Management</a> <li><a><i class="fw fw-settings"></i>Configuration Management</a>
<ul> <ul>
{{#if permissions.TENANT_CONFIGURATION}}
<li><a href="{{@app.context}}/platform-configuration"><i class="fw fw-service"></i>Platform Configurations</a> <li><a href="{{@app.context}}/platform-configuration"><i class="fw fw-service"></i>Platform Configurations</a>
</li> </li>
{{/if}}
<!-- todo change the permission and get the related permission --> <!-- todo change the permission and get the related permission -->
{{#if permissions.TENANT_CONFIGURATION}}
<li><a href="{{@app.context}}/certificates"><i class="fw fw-security-policy"></i>Certificate Configurations</a> <li><a href="{{@app.context}}/certificates"><i class="fw fw-security-policy"></i>Certificate Configurations</a>
</li> </li>
{{/if}}
</ul> </ul>
</li> </li>
{{/if}}
{{/zone}} {{/zone}}
{{#zone "navbarCollapsableRightItems"}} {{#zone "navbarCollapsableRightItems"}}

Loading…
Cancel
Save