cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [01/20] git commit: updated refs/heads/4.3 to 67df5b9
Date Tue, 25 Nov 2014 19:04:57 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 f72eb9455 -> 67df5b9da


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)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.3
Commit: 30dd76fc6540c307d5caa26ddb056f60a379cc80
Parents: f72eb94
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Fri Jul 18 17:51:02 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Nov 25 22:36:55 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30dd76fc/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 8bae584..d3f3946 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1797,6 +1797,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