mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 9729 : Permission change - allow root admin to use anybody's private template.
status 9729: resolved fixed
This commit is contained in:
parent
4a47d19c84
commit
0ebce2024b
@ -549,5 +549,8 @@ public abstract class BaseCmd {
|
||||
(accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) ||
|
||||
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) ||
|
||||
(accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
|
||||
}
|
||||
}
|
||||
public static boolean isRootAdmin(short accountType) {
|
||||
return ((accountType == Account.ACCOUNT_TYPE_ADMIN));
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class DomainChecker extends AdapterBase implements SecurityChecker {
|
||||
// validate that the template is usable by the account
|
||||
if (!template.isPublicTemplate()) {
|
||||
Account owner = _accountDao.findById(template.getAccountId());
|
||||
if (BaseCmd.isAdmin(caller.getType()) || (owner.getId() == caller.getId())) {
|
||||
if (BaseCmd.isRootAdmin(caller.getType()) || (owner.getId() == caller.getId())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user