Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4965,16 +4965,13 @@ private Pair<List<TemplateJoinVO>, Integer> searchForTemplatesInternal(Long temp
ex.addProxyObject(template.getUuid(), "templateId");
throw ex;
}

if (!template.isPublicTemplate() && caller.getType() == Account.Type.DOMAIN_ADMIN) {
Account template_acc = accountMgr.getAccount(template.getAccountId());
DomainVO domain = _domainDao.findById(template_acc.getDomainId());
accountMgr.checkAccess(caller, domain);
}

// if template is not public, perform permission check here
else if (!template.isPublicTemplate() && caller.getType() != Account.Type.ADMIN) {
accountMgr.checkAccess(caller, null, false, template);
} else if (template.isPublicTemplate()) {
} else if (template.isPublicTemplate() || caller.getType() != Account.Type.ADMIN) {
// if template is not public or non-admin caller, perform permission check here
accountMgr.checkAccess(caller, null, false, template);
}

Expand Down
Loading