cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to de85c4d
Date Fri, 08 Aug 2014 10:16:33 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 b2efdf20c -> de85c4d55


CLOUDSTACK-7129: Non-admin user can use deleteNetwork with shared
networks

fix ensures only admin users can delete shared network

(cherry picked from commit 2f293f42d567b1218cb083250707eeffc5324dc3)


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

Branch: refs/heads/4.4
Commit: de85c4d555e7d8de2e6dd7fd888003f6bf289e71
Parents: b2efdf2
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Fri Jul 18 17:51:02 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Fri Aug 8 12:15:40 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkServiceImpl.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de85c4d5/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 6c6fd61..520ed98 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1837,6 +1837,11 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
 
         Account owner = _accountMgr.getAccount(network.getAccountId());
 
+        // Only Admin can delete Shared networks
+        if (network.getGuestType() == GuestType.Shared && !_accountMgr.isAdmin(caller.getId()))
{
+            throw new InvalidParameterValueException("Only Admins can delete network with
guest type " + GuestType.Shared);
+        }
+
         // Perform permission check
         _accountMgr.checkAccess(caller, null, true, network);
 


Mime
View raw message