Updated Branches: refs/heads/master cbfb4e397 -> f68a74ead
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/master Commit: f68a74eadab2394427b7355bfa39568982aa5933 Parents: cbfb4e3 Author: Alena Prokharchyk <[email protected]> Authored: Mon Jul 8 11:15:27 2013 -0700 Committer: Alena Prokharchyk <[email protected]> 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; }
