mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Removed hardcoded admin user name.
This commit is contained in:
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…
Reference in New Issue
Block a user