cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master-6-17-stable to f54f012
Date Thu, 11 Jul 2013 08:26:26 GMT
Updated Branches:
  refs/heads/master-6-17-stable b560369b3 -> f54f012e6


CLOUDSTACK-3447. CLOUDSTACK-3448.
Correct the access check on networks in APIs addNicToVM and removeNicFromVM


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

Branch: refs/heads/master-6-17-stable
Commit: f54f012e66d6a67948abeb50215bbdcc58c0251b
Parents: b560369
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Thu Jul 11 13:46:25 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Thu Jul 11 13:50:29 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f54f012e/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 3a695f3..4f5b1d0 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -864,13 +864,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
         }
 
         // Perform account permission check on network
-        if (network.getGuestType() != Network.GuestType.Shared) {
-            // Check account permissions
-            List<NetworkVO> networkMap = _networkDao.listBy(caller.getId(), network.getId());
-            if ((networkMap == null || networkMap.isEmpty() ) && caller.getType()
!= Account.ACCOUNT_TYPE_ADMIN) {
-                throw new PermissionDeniedException("Unable to modify a vm using network
with id " + network.getId() + ", permission denied");
-            }
-        }
+        _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
 
         //ensure network belongs in zone
         if (network.getDataCenterId() != vmInstance.getDataCenterId()) {
@@ -941,13 +935,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
         }
 
         // Perform account permission check on network
-        if (network.getGuestType() != Network.GuestType.Shared) {
-            // Check account permissions
-            List<NetworkVO> networkMap = _networkDao.listBy(caller.getId(), network.getId());
-            if ((networkMap == null || networkMap.isEmpty() ) && caller.getType()
!= Account.ACCOUNT_TYPE_ADMIN) {
-                throw new PermissionDeniedException("Unable to modify a vm using network
with id " + network.getId() + ", permission denied");
-            }
-        }
+        _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
 
         boolean nicremoved = false;
 


Mime
View raw message