Skip to content

Commit 875223c

Browse files
committed
Merge branch '4.20' of https://github.com/apache/cloudstack
2 parents bce17b6 + 41de0b9 commit 875223c

File tree

9 files changed

+885
-223
lines changed

9 files changed

+885
-223
lines changed

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,16 +1579,20 @@ public UserAccount updateUser(UpdateUserCmd updateUserCmd) {
15791579
public void verifyCallerPrivilegeForUserOrAccountOperations(Account userAccount) {
15801580
logger.debug(String.format("Verifying whether the caller has the correct privileges based on the user's role type and API permissions: %s", userAccount));
15811581

1582-
checkCallerRoleTypeAllowedForUserOrAccountOperations(userAccount, null);
1583-
checkCallerApiPermissionsForUserOrAccountOperations(userAccount);
1582+
if (!Account.Type.PROJECT.equals(userAccount.getType())) {
1583+
checkCallerRoleTypeAllowedForUserOrAccountOperations(userAccount, null);
1584+
checkCallerApiPermissionsForUserOrAccountOperations(userAccount);
1585+
}
15841586
}
15851587

15861588
protected void verifyCallerPrivilegeForUserOrAccountOperations(User user) {
15871589
logger.debug(String.format("Verifying whether the caller has the correct privileges based on the user's role type and API permissions: %s", user));
15881590

15891591
Account userAccount = getAccount(user.getAccountId());
1590-
checkCallerRoleTypeAllowedForUserOrAccountOperations(userAccount, user);
1591-
checkCallerApiPermissionsForUserOrAccountOperations(userAccount);
1592+
if (!Account.Type.PROJECT.equals(userAccount.getType())) {
1593+
checkCallerRoleTypeAllowedForUserOrAccountOperations(userAccount, user);
1594+
checkCallerApiPermissionsForUserOrAccountOperations(userAccount);
1595+
}
15921596
}
15931597

15941598
protected void checkCallerRoleTypeAllowedForUserOrAccountOperations(Account userAccount, User user) {
@@ -1597,7 +1601,7 @@ protected void checkCallerRoleTypeAllowedForUserOrAccountOperations(Account user
15971601
RoleType userAccountRoleType = getRoleType(userAccount);
15981602

15991603
if (RoleType.Unknown == callerRoleType || RoleType.Unknown == userAccountRoleType) {
1600-
String errMsg = String.format("The role type of account [%s, %s] or [%s, %s] is unknown",
1604+
String errMsg = String.format("The role type of caller account [%s, %s] or target account [%s, %s] is unknown",
16011605
callingAccount.getName(), callingAccount.getUuid(), userAccount.getName(), userAccount.getUuid());
16021606
throw new PermissionDeniedException(errMsg);
16031607
}
@@ -2707,10 +2711,8 @@ public AccountVO createAccount(final String accountName, final Account.Type acco
27072711
}
27082712
}
27092713

2710-
if (!Account.Type.PROJECT.equals(accountType)) {
2711-
AccountVO newAccount = new AccountVO(accountName, domainId, networkDomain, accountType, roleId, uuid);
2712-
verifyCallerPrivilegeForUserOrAccountOperations(newAccount);
2713-
}
2714+
AccountVO newAccount = new AccountVO(accountName, domainId, networkDomain, accountType, roleId, uuid);
2715+
verifyCallerPrivilegeForUserOrAccountOperations(newAccount);
27142716

27152717
// Create the account
27162718
return Transaction.execute(new TransactionCallback<>() {

tools/appliance/systemvmtemplate/template-base_aarch64-target_aarch64.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"format": "qcow2",
3333
"headless": true,
3434
"http_directory": "http",
35-
"iso_checksum": "sha512:022895e699231c94abf7012f86cabc587dc576f07f856c87609d5d40c1f921d805a5a862cba94c1a47d09aaa565ec445222e338e73d1fa1affc4fc5908bb50ad",
36-
"iso_url": "https://cdimage.debian.org/mirror/cdimage/release/12.10.0/arm64/iso-cd/debian-12.10.0-arm64-netinst.iso",
35+
"iso_checksum": "sha512:892cf1185a214d16ff62a18c6b89cdcd58719647c99916f6214bfca6f9915275d727b666c0b8fbf022c425ef18647e9759974abf7fc440431c39b50c296a98d3",
36+
"iso_url": "https://cdimage.debian.org/mirror/cdimage/release/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso",
3737
"net_device": "virtio-net",
3838
"output_directory": "../dist",
3939
"qemu_binary": "qemu-system-aarch64",

tools/appliance/systemvmtemplate/template-base_x86_64-target_aarch64.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"format": "qcow2",
3232
"headless": true,
3333
"http_directory": "http",
34-
"iso_checksum": "sha512:022895e699231c94abf7012f86cabc587dc576f07f856c87609d5d40c1f921d805a5a862cba94c1a47d09aaa565ec445222e338e73d1fa1affc4fc5908bb50ad",
35-
"iso_url": "https://cdimage.debian.org/mirror/cdimage/release/12.10.0/arm64/iso-cd/debian-12.10.0-arm64-netinst.iso",
34+
"iso_checksum": "sha512:892cf1185a214d16ff62a18c6b89cdcd58719647c99916f6214bfca6f9915275d727b666c0b8fbf022c425ef18647e9759974abf7fc440431c39b50c296a98d3",
35+
"iso_url": "https://cdimage.debian.org/mirror/cdimage/release/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso",
3636
"net_device": "virtio-net",
3737
"output_directory": "../dist",
3838
"qemu_binary": "qemu-system-aarch64",

tools/appliance/systemvmtemplate/template-base_x86_64-target_x86_64.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"format": "qcow2",
2828
"headless": true,
2929
"http_directory": "http",
30-
"iso_checksum": "sha512:cb089def0684fd93c9c2fbe45fd16ecc809c949a6fd0c91ee199faefe7d4b82b64658a264a13109d59f1a40ac3080be2f7bd3d8bf3e9cdf509add6d72576a79b",
31-
"iso_url": "https://cdimage.debian.org/mirror/cdimage/release/12.10.0/amd64/iso-cd/debian-12.10.0-amd64-netinst.iso",
30+
"iso_checksum": "sha512:0921d8b297c63ac458d8a06f87cd4c353f751eb5fe30fd0d839ca09c0833d1d9934b02ee14bbd0c0ec4f8917dde793957801ae1af3c8122cdf28dde8f3c3e0da",
31+
"iso_url": "https://cdimage.debian.org/mirror/cdimage/release/12.11.0/amd64/iso-cd/debian-12.11.0-amd64-netinst.iso",
3232
"net_device": "virtio-net",
3333
"output_directory": "../dist",
3434
"qemuargs": [

0 commit comments

Comments
 (0)