mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 8720: don't allow to create network with custom vlan when networkOffering's guest IP type is Virtual
status 8720: resolved fixed
This commit is contained in:
parent
fd27af5d8f
commit
1dbd012fdc
@ -1529,12 +1529,17 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
||||
}
|
||||
}
|
||||
|
||||
//Don't allow to create guest virtual network with Vlan specified
|
||||
if (networkOffering.getGuestType() == GuestIpType.Virtual && vlanId != null) {
|
||||
throw new InvalidParameterValueException("Can't specify vlan when create network with Guest IP Type " + GuestIpType.Virtual);
|
||||
}
|
||||
|
||||
//Regular user can create guest network only
|
||||
if (ctxAccount.getType() == Account.ACCOUNT_TYPE_NORMAL && networkOffering.getTrafficType() != TrafficType.Guest) {
|
||||
throw new InvalidParameterValueException("Regular user can create a network only from the network offering having traffic type " + TrafficType.Guest);
|
||||
}
|
||||
|
||||
//Don't allow to specify cidr/gateway/vlan if the caller is a regular user
|
||||
//Don't allow to specify cidr if the caller is a regular user
|
||||
if (ctxAccount.getType() == Account.ACCOUNT_TYPE_NORMAL && cidr != null) {
|
||||
throw new InvalidParameterValueException("Regular user is not allowed to specify gateway/netmask/ipRange");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user