Removed hardcoded admin user name.

revert-70aa11f8
Menaka Jayawardena 7 years ago
parent b04bb5f1f1
commit 21b0ed284b

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

@ -46,9 +46,9 @@ function onRequest(context) {
canView = true; canView = true;
} }
//TODO: Remove hardcoded admin user name.
var canEdit = false; 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; canEdit = true;
} }

Loading…
Cancel
Save