You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/07/09 22:46:13 UTC

[31/50] [abbrv] git commit: updated refs/heads/ui-ucs to 9334dab

CLOUDSTACK-3356: list shared networks available for projects when call is executed by the admin who is not a part of the project


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

Branch: refs/heads/ui-ucs
Commit: f68a74eadab2394427b7355bfa39568982aa5933
Parents: cbfb4e3
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Mon Jul 8 11:15:27 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Mon Jul 8 11:28:15 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkServiceImpl.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f68a74ea/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 34eda36..2f833d2 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1419,7 +1419,7 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
             }
         }
 
-        if (!_accountMgr.isAdmin(caller.getType()) || (!listAll && (projectId != null && projectId.longValue() != -1 && domainId == null))) {
+        if (!_accountMgr.isAdmin(caller.getType()) || (projectId != null && projectId.longValue() != -1 && domainId == null)) {
             permittedAccounts.add(caller.getId());
             domainId = caller.getDomainId();
         }
@@ -1443,7 +1443,13 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
                     ex.addProxyObject(project.getUuid(), "projectId");
                     throw ex;
                 }
+                
+                //add project account
                 permittedAccounts.add(project.getProjectAccountId());
+                //add caller account (if admin)
+                if (_accountMgr.isAdmin(caller.getType())) {
+                    permittedAccounts.add(caller.getId());
+                }
             }
             skipProjectNetworks = false;
         }