CLOUDSTACK-2657: listTemplatePermissions API should also include the owner of the template to the list of users having permission to launch

Changes:
- Add template owner to the list of users
This commit is contained in:
Prachi Damle 2013-05-23 16:32:34 -07:00
parent 7e6f3f94ba
commit 780b45e245
1 changed files with 7 additions and 0 deletions

View File

@ -1553,6 +1553,13 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
accountNames.add(acct.getAccountName());
}
}
// also add the owner if not public
if (!template.isPublicTemplate()) {
Account templateOwner = _accountDao.findById(template.getAccountId());
accountNames.add(templateOwner.getAccountName());
}
return accountNames;
}