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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to