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_r296557674
##########
File path: server/src/main/java/com/cloud/api/ApiResponseHelper.java
##########
@@ -1789,8 +1795,23 @@ public TemplatePermissionsResponse
createTemplatePermissionsResponse(ResponseVie
// Set accounts
List<String> projectIds = new ArrayList<String>();
List<String> regularAccounts = new ArrayList<String>();
+ final boolean isRootAdmin =
_accountMgr.isRootAdmin(CallContext.current().getCallingAccountId());
for (String accountName : accountNames) {
- Account account = ApiDBUtils.findAccountByNameDomain(accountName,
templateOwner.getDomainId());
+ // Root Admins should be allowed to access permissions for all
accounts across domains
+ Account account = null;
+ if (isRootAdmin) {
+ List<AccountVO> accounts =
accountDao.findAccountsLike(accountName);
+ if (accounts != null && accounts.size() > 0) {
+ account = accounts.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