Skip to content

Commit de85c4d

Browse files
murali-reddyDaanHoogland
authored andcommitted
CLOUDSTACK-7129: Non-admin user can use deleteNetwork with shared
networks fix ensures only admin users can delete shared network (cherry picked from commit 2f293f4)
1 parent b2efdf2 commit de85c4d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎server/src/com/cloud/network/NetworkServiceImpl.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,11 @@ public boolean deleteNetwork(long networkId, boolean forced) {
18371837

18381838
Account owner = _accountMgr.getAccount(network.getAccountId());
18391839

1840+
// Only Admin can delete Shared networks
1841+
if (network.getGuestType() == GuestType.Shared && !_accountMgr.isAdmin(caller.getId())) {
1842+
throw new InvalidParameterValueException("Only Admins can delete network with guest type " + GuestType.Shared);
1843+
}
1844+
18401845
// Perform permission check
18411846
_accountMgr.checkAccess(caller, null, true, network);
18421847

0 commit comments

Comments
 (0)