You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2012/10/10 01:34:20 UTC

[1/2] git commit: Fixed ipAssoc and createNetworkACL (for vpc) commands - didn't work in Project scenario

Updated Branches:
  refs/heads/master f4a2298ca -> 823f0c966


Fixed ipAssoc and createNetworkACL (for vpc) commands - didn't work in Project scenario

Conflicts:

	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java


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

Branch: refs/heads/master
Commit: 823f0c96692cc0d3fe7ffae0beb2ebe15eb37e2c
Parents: 43b4062
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Oct 4 12:11:37 2012 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Tue Oct 9 16:26:26 2012 -0700

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java  |    2 +-
 .../cloud/network/vpc/NetworkACLManagerImpl.java   |    5 ++++-
 .../src/com/cloud/server/ManagementServerImpl.java |    4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/823f0c96/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 25c0032..7b38c83 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -1142,7 +1142,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
         
         Network network = _networksDao.findById(networkId);
         if (network != null) {
-            _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
+            _accountMgr.checkAccess(owner, AccessType.UseNetwork, false, network);
         } else {
             s_logger.debug("Unable to find ip address by id: " + ipId);
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/823f0c96/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
index 3375714..e3483a0 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
@@ -137,8 +137,11 @@ public class NetworkACLManagerImpl implements Manager,NetworkACLManager{
         Vpc vpc = _vpcMgr.getVpc(network.getVpcId());
         Account aclOwner = _accountMgr.getAccount(vpc.getAccountId());
         
-        _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
+        //check if the caller can access vpc
+        _accountMgr.checkAccess(caller, null, false, vpc);
 
+        //check if the acl can be created for this network
+        _accountMgr.checkAccess(aclOwner, AccessType.UseNetwork, false, network);
         
         if (!_networkMgr.areServicesSupportedInNetwork(networkId, Service.NetworkACL)) {
             throw new InvalidParameterValueException("Service " + Service.NetworkACL + " is not supported in network " + network);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/823f0c96/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index ea32dbb..d043ab1 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -1263,7 +1263,7 @@ public class ManagementServerImpl implements ManagementServer {
         boolean listAll = false;
         if (isoFilter != null && isoFilter == TemplateFilter.all) {
             if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
-                throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only", null);
+                throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");
             }
             listAll = true;
         }
@@ -1292,7 +1292,7 @@ public class ManagementServerImpl implements ManagementServer {
         boolean listAll = false;
         if (templateFilter != null && templateFilter == TemplateFilter.all) {
             if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
-                throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only", null);
+                throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");
             }
             listAll = true;
         }