bug 9729 : Permission change - allow root admin to use anybody's private template.

status 9729: resolved fixed
This commit is contained in:
nit 2011-06-02 15:14:32 +05:30
parent 4a47d19c84
commit 0ebce2024b
2 changed files with 5 additions and 2 deletions

View File

@ -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));
}
}

View File

@ -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;
}