cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.4 to 563efad
Date Thu, 17 Apr 2014 17:58:18 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 8d371ab03 -> 563efad9a


CLOUDSTACK-6429:distinguish the case where caller can see everything and
the case where caller cannot see anything. Also change behavior to
default isRecursive to false if not specified.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/563efad9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/563efad9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/563efad9

Branch: refs/heads/4.4
Commit: 563efad9aee29ea31f10381694c5b55791d561fc
Parents: 8d371ab
Author: Min Chen <min.chen@citrix.com>
Authored: Thu Apr 17 10:46:45 2014 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Apr 17 10:50:52 2014 -0700

----------------------------------------------------------------------
 .../org/apache/cloudstack/api/BaseListDomainResourcesCmd.java | 3 +--
 server/src/com/cloud/user/AccountManagerImpl.java             | 7 +++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/563efad9/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java b/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
index 3257d65..79f7edc 100644
--- a/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
@@ -39,8 +39,7 @@ public abstract class BaseListDomainResourcesCmd extends BaseListCmd {
     }
 
     public boolean isRecursive() {
-        // if listAll is true, recursive is not specified, then recursive should default
to true.
-        return recursive == null ? (listAll() ? true : false) : recursive;
+        return recursive == null ? false : recursive;
     }
 
     public Long getDomainId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/563efad9/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 567617c..cabef40 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -2303,6 +2303,13 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager,
M
                     permittedAccounts.addAll(grantedAccounts);
                     permittedResources.addAll(grantedResources);
                 }
+
+                if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() &
permittedResources.isEmpty()) {
+                    // if at this point, all permitted arrays are empty, that means that
caller cannot see anything, we put -1 in permittedAccounts
+                    // to distinguish this case from the case that caller can see everything
+                    permittedAccounts.add(-1L);
+
+                }
             }
         }
     }


Mime
View raw message