cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [3/4] git commit: updated refs/heads/master to 29f3914
Date Fri, 18 Apr 2014 01:40:26 GMT
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/c25332fc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c25332fc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c25332fc

Branch: refs/heads/master
Commit: c25332fc4639aecc5eddf4b69176f3fd120b2871
Parents: bc525d2
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 18:33:08 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/c25332fc/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/c25332fc/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 0d4b72d..b48f047 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -2280,6 +2280,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