cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] branch master updated: CLOUDSTACK-9955 : Featured Templates/Iso's created by Root/admin user are not visible to Domain Admin users (#2144)
Date Fri, 04 Aug 2017 18:59:10 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 6203013  CLOUDSTACK-9955 : Featured Templates/Iso's created by Root/admin user are
not visible to Domain Admin users (#2144)
6203013 is described below

commit 6203013ec6b9bf09bf94f48150a4f72aba598424
Author: niteshsarda <nitesh_sarda@accelerite.com>
AuthorDate: Sat Aug 5 00:29:07 2017 +0530

    CLOUDSTACK-9955 : Featured Templates/Iso's created by Root/admin user are not visible
to Domain Admin users (#2144)
    
    ISSUE: Featured Templates/Iso's created by Root/admin user are not visible to Domain Admin
users.
    
    STEPS TO REPRODUCE
    
    Mark a template as featured and try to view it from a domain admin user
    The issue occurs for both templates and iso's registered before and after upgrade
    Templates,ISO's whose owner is ROOT admin, public: Yes, featured: Yes
    Log in to UI (as a domain admin, such as an admin of “TEST/TEST1” domain)
    Choose “Templates”.
    Error message will be shown on UI
---
 server/src/com/cloud/api/query/QueryManagerImpl.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index f8e0307..9ed1cde 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -3147,13 +3147,13 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase
implements Q
                 ex.addProxyObject(template.getUuid(), "templateId");
                 throw ex;
             }
-            if (caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) {
+            if (!template.isPublicTemplate() && 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
+            // 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);
             }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].

Mime
View raw message