cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/4.4-forward to 98d9b8f
Date Thu, 24 Apr 2014 21:48:01 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward a542b6fd8 -> 98d9b8fc3


CLOUDSTACK-6436: listResourceDetails - don't return entries set with display=false, by default


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

Branch: refs/heads/4.4-forward
Commit: 98d9b8fc3fe9bf5e016d7541c1c2c369139e65af
Parents: a542b6f
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Apr 24 14:28:31 2014 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Apr 24 14:32:10 2014 -0700

----------------------------------------------------------------------
 .../cloudstack/api/command/user/vm/ListNicsCmd.java   |  7 +++----
 .../command/user/volume/ListResourceDetailsCmd.java   | 14 +++++++-------
 server/src/com/cloud/api/query/QueryManagerImpl.java  |  2 +-
 3 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98d9b8fc/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
index 408497c..49402dc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
@@ -99,11 +99,10 @@ public class ListNicsCmd extends BaseListCmd {
 
 
     public Boolean getDisplay() {
-        Account caller = CallContext.current().getCallingAccount();
-        if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
-            return true;
+        if (display != null) {
+            return display;
         }
-        return display;
+        return true;
     }
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98d9b8fc/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
index ebec4b1..93dc29d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.user.volume;
 
 import java.util.List;
 
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +27,6 @@ import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.ResourceDetailResponse;
 import org.apache.cloudstack.api.response.ResourceTagResponse;
-import org.apache.cloudstack.context.CallContext;
 
 import com.cloud.server.ResourceTag;
 
@@ -45,7 +45,7 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
     private String key;
 
     @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"if set to true, only details marked with display=true, are returned."
-        + " Always false is the call is made by the regular user", since = "4.3")
+            + " False by default", since = "4.3", authorized = { RoleType.Admin })
     private Boolean forDisplay;
 
     public String getResourceId() {
@@ -61,12 +61,12 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
         return s_name;
     }
 
-    public Boolean forDisplay() {
-        if (!_accountService.isAdmin(CallContext.current().getCallingAccount().getId()))
{
-            return true;
+    @Override
+    public Boolean getDisplay() {
+        if (forDisplay != null) {
+            return forDisplay;
         }
-
-        return forDisplay;
+        return super.getDisplay();
     }
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98d9b8fc/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 4450be8..fb8b020 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -3320,7 +3320,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
     @Override
     public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd
cmd) {
         String key = cmd.getKey();
-        Boolean forDisplay = cmd.forDisplay();
+        Boolean forDisplay = cmd.getDisplay();
         ResourceTag.ResourceObjectType resourceType = cmd.getResourceType();
         String resourceIdStr = cmd.getResourceId();
         Long resourceId = null;


Mime
View raw message