Skip to content

Commit 0ebce20

Browse files
bug 9729 : Permission change - allow root admin to use anybody's private template.
status 9729: resolved fixed
1 parent 4a47d19 commit 0ebce20

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎api/src/com/cloud/api/BaseCmd.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,5 +549,8 @@ public static boolean isAdmin(short accountType) {
549549
(accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) ||
550550
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) ||
551551
(accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
552-
}
552+
}
553+
public static boolean isRootAdmin(short accountType) {
554+
return ((accountType == Account.ACCOUNT_TYPE_ADMIN));
555+
}
553556
}

‎server/src/com/cloud/acl/DomainChecker.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public boolean checkAccess(Account caller, ControlledEntity entity) throws Permi
8282
// validate that the template is usable by the account
8383
if (!template.isPublicTemplate()) {
8484
Account owner = _accountDao.findById(template.getAccountId());
85-
if (BaseCmd.isAdmin(caller.getType()) || (owner.getId() == caller.getId())) {
85+
if (BaseCmd.isRootAdmin(caller.getType()) || (owner.getId() == caller.getId())) {
8686
return true;
8787
}
8888

0 commit comments

Comments
 (0)