mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7129: Non-admin user can use deleteNetwork with shared
networks fix ensures only admin users can delete shared network
This commit is contained in:
parent
c1aed55583
commit
2f293f42d5
|
|
@ -1838,6 +1838,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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue