You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by koushik-das <gi...@git.apache.org> on 2015/08/04 11:22:08 UTC

[GitHub] cloudstack pull request: Only admin or owner of the template can c...

Github user koushik-das commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/648#discussion_r36170620
  
    --- Diff: server/src/com/cloud/template/TemplateManagerImpl.java ---
    @@ -1354,6 +1354,10 @@ public boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissions
             //Derive the domain id from the template owner as updateTemplatePermissions is not cross domain operation
             Account owner = _accountMgr.getAccount(ownerId);
             final Domain domain = _domainDao.findById(owner.getDomainId());
    +        //Only admin or owner of the template should be able to change its permissions
    --- End diff --
    
    @manuiiit Can you move this check up, possibly after the following code
            Long ownerId = template.getAccountId();
            if (ownerId == null) {
                // if there is no owner of the template then it's probably already a
                // public template (or domain private template) so
                // publishing to individual users is irrelevant
                throw new InvalidParameterValueException("Update template permissions is an invalid operation on template " + template.getName());
            }



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---