Updated Branches: refs/heads/master-6-17-stable e3e16ba0f -> 7eff343e4
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/7eff343e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7eff343e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7eff343e Branch: refs/heads/master-6-17-stable Commit: 7eff343e4948468e94377a0e86658e9fe1e36c1e Parents: e3e16ba Author: Alena Prokharchyk <[email protected]> Authored: Mon Jul 8 11:15:27 2013 -0700 Committer: Alena Prokharchyk <[email protected]> Committed: Mon Jul 8 11:27:50 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/7eff343e/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 385cfb6..49bfb88 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -1413,7 +1413,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(); } @@ -1437,7 +1437,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; }
