|
66 | 66 | add: { |
67 | 67 | label: 'label.add.account', |
68 | 68 | preFilter: function(args) { |
69 | | - if (isAdmin()) |
| 69 | + if (isAdmin() || isDomainAdmin()) |
70 | 70 | return true; |
71 | 71 | else |
72 | 72 | return false; |
|
1103 | 1103 | label: 'label.add.user', |
1104 | 1104 |
|
1105 | 1105 | preFilter: function(args) { |
1106 | | - if (isAdmin()) |
| 1106 | + if (isAdmin() || isDomainAdmin()) |
1107 | 1107 | return true; |
1108 | 1108 | else |
1109 | 1109 | return false; |
|
1602 | 1602 | } |
1603 | 1603 | allowedActions.push("updateResourceCount"); |
1604 | 1604 | } else if (isDomainAdmin()) { |
| 1605 | + if (jsonObj.name != g_account) { |
| 1606 | + allowedActions.push("edit"); //updating networkdomain is allowed on any account, including system-generated default admin account |
| 1607 | + if (jsonObj.state == "enabled") { |
| 1608 | + allowedActions.push("disable"); |
| 1609 | + allowedActions.push("lock"); |
| 1610 | + } else if (jsonObj.state == "disabled" || jsonObj.state == "locked") { |
| 1611 | + allowedActions.push("enable"); |
| 1612 | + } |
| 1613 | + allowedActions.push("remove"); |
| 1614 | + } |
1605 | 1615 | allowedActions.push("updateResourceCount"); |
1606 | 1616 | } |
1607 | 1617 | return allowedActions; |
|
1627 | 1637 | } |
1628 | 1638 | } else { |
1629 | 1639 | if (isSelfOrChildDomainUser(jsonObj.username, jsonObj.accounttype, jsonObj.domainid, jsonObj.iscallerchilddomain)) { |
| 1640 | + if (isDomainAdmin() && jsonObj.username != g_username) { |
| 1641 | + allowedActions.push("edit"); |
| 1642 | + if (jsonObj.state == "enabled") |
| 1643 | + allowedActions.push("disable"); |
| 1644 | + if (jsonObj.state == "disabled") |
| 1645 | + allowedActions.push("enable"); |
| 1646 | + allowedActions.push("remove"); |
| 1647 | + } |
1630 | 1648 | allowedActions.push("changePassword"); |
1631 | 1649 | allowedActions.push("generateKeys"); |
1632 | 1650 | } |
|
0 commit comments