Disabled edit button for admin role.

merge-requests/1/head
Menaka Jayawardena 7 years ago
parent 7cf67b4be5
commit b04bb5f1f1

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

@ -18,8 +18,6 @@
function onRequest(context) {
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var username = request.getParameter("username");
var user = userModule.getUser(username)["content"];
var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var isExsistingUser = false;
var userName = request.getParameter("username");
@ -48,8 +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")) {
if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit") && userName !== 'admin') {
canEdit = true;
}

Loading…
Cancel
Save