You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2013/01/31 00:32:43 UTC

git commit: refs/heads/add_remove_nics - Summary: allow admin user to do whatever he wants

Updated Branches:
  refs/heads/add_remove_nics e430b7aed -> 437d30a29


Summary: allow admin user to do whatever he wants

Reported-by: Ryan Dietrich <ry...@betterservers.com>
Signed-off-by: Marcus Sorensen <ma...@betterservers.com> 1359588792 -0700


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

Branch: refs/heads/add_remove_nics
Commit: 437d30a295ee482f97e3c6f45227970b107af72b
Parents: e430b7a
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Wed Jan 30 16:33:12 2013 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Wed Jan 30 16:33:12 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/437d30a2/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 fd3fffd..82a8e25 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -954,7 +954,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
         if (network.getGuestType() != Network.GuestType.Shared) {
             // Check account permissions
             List<NetworkVO> networkMap = _networkDao.listBy(caller.getId(), network.getId());
-            if (networkMap == null || networkMap.isEmpty()) {
+            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");
             }
         }
@@ -1031,7 +1031,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
         if (network.getGuestType() != Network.GuestType.Shared) {
             // Check account permissions
             List<NetworkVO> networkMap = _networkDao.listBy(caller.getId(), network.getId());
-            if (networkMap == null || networkMap.isEmpty()) {
+            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");
             }
         }