Skip to content

Commit 309be01

Browse files
author
Jessica Wang
committed
CLOUDSTACK-109: cloudstack UI - (1) account page: fix a bug that system-generated default admin account wrongly had enalbe/disable/lock/remove option. (2) user page - fix a bug that system-generated default admin account user wrongly had enable/disable/remove option.
1 parent fe4cd5e commit 309be01

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

ui/scripts/accounts.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
var domainObjs;
2020
var rootDomainId;
2121

22-
var systemAccountId = 1;
23-
var adminAccountId = 2;
24-
25-
var systemUserId = 1;
26-
var adminUserId = 2;
27-
2822
cloudStack.sections.accounts = {
2923
title: 'label.accounts',
3024
id: 'accounts',
@@ -1097,7 +1091,7 @@
10971091
if (jsonObj.state == 'Destroyed') return [];
10981092

10991093
if(isAdmin()) {
1100-
if(jsonObj.id != systemAccountId && jsonObj.id != adminAccountId) {
1094+
if(!(jsonObj.domain == "ROOT" && jsonObj.name == "admin" && jsonObj.accounttype == 1)) { //if not system-generated default admin account
11011095
//allowedActions.push("edit");
11021096
if (jsonObj.accounttype == roleTypeUser || jsonObj.accounttype == roleTypeDomainAdmin) {
11031097
//allowedActions.push("updateResourceLimits");
@@ -1127,7 +1121,7 @@
11271121
allowedActions.push("edit");
11281122
allowedActions.push("changePassword");
11291123
allowedActions.push("generateKeys");
1130-
if(jsonObj.id != systemUserId && jsonObj.id != adminUserId) {
1124+
if(!(jsonObj.domain == "ROOT" && jsonObj.account == "admin" && jsonObj.accounttype == 1)) { //if not system-generated default admin account user
11311125
if(jsonObj.state == "enabled")
11321126
allowedActions.push("disable");
11331127
if(jsonObj.state == "disabled")

0 commit comments

Comments
 (0)