Removed hardcoded admin user name.

4.x.x
Menaka Jayawardena 7 years ago
parent b04bb5f1f1
commit 21b0ed284b

@ -150,8 +150,7 @@ function loadRoles() {
var innerhtml = '';
//TODO: Remove the hardcoded admin role name.
var isAdmin = data.name === 'admin';
var isAdminRole = $("#role-table").data("role") === data.name;
var editLink = '<a onclick="javascript:loadRoleBasedActionURL(\'edit\', \'' + data.name + '\')" ' +
'data-role="' + data.name + '" ' +
@ -199,7 +198,7 @@ function loadRoles() {
'<span class="hidden-xs hidden-on-grid-view">Remove</span>' +
'</a>';
if (!isCloud && !isAdmin) {
if (!isCloud && !isAdminRole) {
innerhtml = editLink + editPermissionLink + removeLink;
}
return innerhtml;

@ -46,9 +46,9 @@ function onRequest(context) {
canView = true;
}
//TODO: Remove hardcoded admin user name.
var canEdit = false;
if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit") && userName !== 'admin') {
if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit") &&
userName !== deviceMgtProps['adminUser'].split("@")[0]) {
canEdit = true;
}

Loading…
Cancel
Save