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);
var permissions = {
"/permission/admin/device-mgt/devices/enroll": ["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"]
"/permission/admin/Login": ["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-admin", ["admin"], adminPermissions);

@ -45,33 +45,33 @@
</a>
</li>
{{/if}}
<li><a><i class="fw fw-user"></i>User Management</a>
<ul>
{{#if permissions.LIST_USERS}}
<li><a href="{{@app.context}}/users"><i class="fw fw-user"></i>Users</a></li>
{{/if}}
{{#if userMgtEnabled}}
<li><a><i class="fw fw-user"></i>User Management</a>
<ul>
{{#if permissions.LIST_USERS}}
<li><a href="{{@app.context}}/users"><i class="fw fw-user"></i>Users</a></li>
{{/if}}
{{#if permissions.LIST_ROLES}}
<li><a href="{{@app.context}}/roles"><i class="fw fw-bookmark"></i>Roles</a></li>
{{/if}}
</ul>
</li>
{{#if permissions.LIST_ROLES}}
<li><a href="{{@app.context}}/roles"><i class="fw fw-bookmark"></i>Roles</a></li>
{{/if}}
</ul>
</li>
{{/if}}
{{#if permissions.LIST_POLICIES}}
<li><a href="{{@app.context}}/policies"><i class="fw fw-policy"></i>Policy Management</a></li>
{{/if}}
<li><a><i class="fw fw-settings"></i>Configuration Management</a>
<ul>
{{#if permissions.TENANT_CONFIGURATION}}
{{#if permissions.TENANT_CONFIGURATION}}
<li><a><i class="fw fw-settings"></i>Configuration Management</a>
<ul>
<li><a href="{{@app.context}}/platform-configuration"><i class="fw fw-service"></i>Platform Configurations</a>
</li>
{{/if}}
<!-- todo change the permission and get the related permission -->
{{#if permissions.TENANT_CONFIGURATION}}
<!-- todo change the permission and get the related permission -->
<li><a href="{{@app.context}}/certificates"><i class="fw fw-security-policy"></i>Certificate Configurations</a>
</li>
{{/if}}
</ul>
</li>
</ul>
</li>
{{/if}}
{{/zone}}
{{#zone "navbarCollapsableRightItems"}}

Loading…
Cancel
Save