anuragaw commented on a change in pull request #3241: [WIP DO NOT MERGE] Allow 
users to share templates with Accounts or Projects through the
URL: https://github.com/apache/cloudstack/pull/3241#discussion_r296557665
 
 

 ##########
 File path: server/src/main/java/com/cloud/template/TemplateManagerImpl.java
 ##########
 @@ -1578,7 +1585,15 @@ public void 
doInTransactionWithoutResult(TransactionStatus status) {
         } else if ("remove".equalsIgnoreCase(operation)) {
             List<Long> accountIds = new ArrayList<Long>();
             for (String accountName : accountNames) {
-                Account permittedAccount = 
_accountDao.findActiveAccount(accountName, domain.getId());
+                Account permittedAccount = null;
+                if (isCallerRootAdmin) {
+                    List<AccountVO> accountsWthName = 
_accountDao.findAccountsLike(accountName);
+                    if (accountsWthName.size() > 0) {
+                        permittedAccount = accountsWthName.get(0);
 
 Review comment:
   No longer part of PR as above.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to