You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/04/09 15:52:47 UTC
[GitHub] rafaelweingartner commented on a change in pull request #2556: List
template with id no longer works as domain admin
rafaelweingartner commented on a change in pull request #2556: List template with id no longer works as domain admin
URL: https://github.com/apache/cloudstack/pull/2556#discussion_r180141926
##########
File path: server/src/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -3147,15 +3147,16 @@ private boolean isPermissible(Long accountDomainId, Long offeringDomainId) {
ex.addProxyObject(template.getUuid(), "templateId");
throw ex;
}
- if (caller.getType() == Account.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.ACCOUNT_TYPE_ADMIN) {
- _accountMgr.checkAccess(caller, null, false, template);
+ // if template is not public, perform permission check here
+ if (!template.isPublicTemplate()) {
Review comment:
Would you mind extracting this block 3151-3159 to a method, document it, and write unit tests?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services