You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2022/11/25 08:49:27 UTC

[cloudstack] branch 4.17 updated: server: fix domain shared public template check (#6916)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/4.17 by this push:
     new 6c436ec90e2 server: fix domain shared public template check (#6916)
6c436ec90e2 is described below

commit 6c436ec90e2b89d33ce9da6f988c44a9c8df6467
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Fri Nov 25 14:19:16 2022 +0530

    server: fix domain shared public template check (#6916)
    
    Fixes #6885
    
    Fixes the incorrect inverted check.
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
---
 server/src/main/java/com/cloud/acl/DomainChecker.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/src/main/java/com/cloud/acl/DomainChecker.java b/server/src/main/java/com/cloud/acl/DomainChecker.java
index bf7bd52ece7..a8c9ab84f7e 100644
--- a/server/src/main/java/com/cloud/acl/DomainChecker.java
+++ b/server/src/main/java/com/cloud/acl/DomainChecker.java
@@ -120,7 +120,7 @@ public class DomainChecker extends AdapterBase implements SecurityChecker {
      */
 
     private void checkPublicTemplateAccess(VirtualMachineTemplate template, Account owner, Account caller){
-        if (!QueryService.SharePublicTemplatesWithOtherDomains.valueIn(owner.getDomainId()) ||
+        if (QueryService.SharePublicTemplatesWithOtherDomains.valueIn(owner.getDomainId()) ||
                 caller.getDomainId() == owner.getDomainId() ||
                 _domainDao.isChildDomain(owner.getDomainId(), caller.getDomainId())) {
             return;