Skip to content

Commit 64d83ce

Browse files
nvazquezbernardodemarco
authored andcommitted
Fix access to template/ISO list for domain/resource admins
In Apache CloudStack, while using the listTemplates and listIsos APIs, Domain Admins and Resource Admins can retrieve templates and ISOs outside their intended scope. Co-authored-by: bernardodemarco <[email protected]> Co-authored-by: nvazquez <[email protected]>
1 parent 16fc2cd commit 64d83ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4660,7 +4660,7 @@ else if (!template.isPublicTemplate() && caller.getType() != Account.Type.ADMIN)
46604660
if (!permittedAccounts.isEmpty()) {
46614661
domain = _domainDao.findById(permittedAccounts.get(0).getDomainId());
46624662
} else {
4663-
domain = _domainDao.findById(Domain.ROOT_DOMAIN);
4663+
domain = _domainDao.findById(caller.getDomainId());
46644664
}
46654665

46664666
setIdsListToSearchCriteria(sc, ids);

0 commit comments

Comments
 (0)