mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2487: Show error while adding acl_item to default ACL
This commit is contained in:
parent
be9850161e
commit
3388b77156
|
|
@ -216,8 +216,8 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
|
|||
throw new InvalidParameterValueException("Network ACL can be created just for networks of type " + Networks.TrafficType.Guest);
|
||||
}
|
||||
|
||||
if(aclId != NetworkACL.DEFAULT_DENY) {
|
||||
//ACL is not default DENY
|
||||
if(aclId != NetworkACL.DEFAULT_DENY && aclId != NetworkACL.DEFAULT_ALLOW) {
|
||||
//ACL is not default DENY/ALLOW
|
||||
// ACL should be associated with a VPC
|
||||
Vpc vpc = _vpcMgr.getVpc(acl.getVpcId());
|
||||
if(vpc == null){
|
||||
|
|
@ -254,6 +254,10 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
|
|||
throw new InvalidParameterValueException("Unable to find specified ACL");
|
||||
}
|
||||
|
||||
if((aclId == NetworkACL.DEFAULT_DENY) || (aclId == NetworkACL.DEFAULT_ALLOW)){
|
||||
throw new InvalidParameterValueException("Default ACL cannot be modified");
|
||||
}
|
||||
|
||||
Vpc vpc = _vpcMgr.getVpc(acl.getVpcId());
|
||||
if(vpc == null){
|
||||
throw new InvalidParameterValueException("Unable to find Vpc associated with the NetworkACL");
|
||||
|
|
|
|||
Loading…
Reference in New Issue