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

4.x.x
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,33 +45,33 @@
</a> </a>
</li> </li>
{{/if}} {{/if}}
<li><a><i class="fw fw-user"></i>User Management</a> {{#if userMgtEnabled}}
<ul> <li><a><i class="fw fw-user"></i>User Management</a>
{{#if permissions.LIST_USERS}} <ul>
<li><a href="{{@app.context}}/users"><i class="fw fw-user"></i>Users</a></li> {{#if permissions.LIST_USERS}}
{{/if}} <li><a href="{{@app.context}}/users"><i class="fw fw-user"></i>Users</a></li>
{{/if}}
{{#if permissions.LIST_ROLES}} {{#if permissions.LIST_ROLES}}
<li><a href="{{@app.context}}/roles"><i class="fw fw-bookmark"></i>Roles</a></li> <li><a href="{{@app.context}}/roles"><i class="fw fw-bookmark"></i>Roles</a></li>
{{/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}}
<li><a><i class="fw fw-settings"></i>Configuration Management</a> {{#if permissions.TENANT_CONFIGURATION}}
<ul> <li><a><i class="fw fw-settings"></i>Configuration Management</a>
{{#if permissions.TENANT_CONFIGURATION}} <ul>
<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