CLOUDSTACK-8072: Fixed NPE in deleting default ACL items in default ACL

This commit is contained in:
Jayapal 2014-12-15 15:41:30 +05:30
parent 6321a29e43
commit aca0f79592
1 changed files with 4 additions and 3 deletions

View File

@ -612,13 +612,14 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId());
if((aclItem.getAclId() == NetworkACL.DEFAULT_ALLOW) || (aclItem.getAclId() == NetworkACL.DEFAULT_DENY)){
throw new InvalidParameterValueException("ACL Items in default ACL cannot be deleted");
}
Account caller = CallContext.current().getCallingAccount();
_accountMgr.checkAccess(caller, null, true, vpc);
if((aclItem.getAclId() == NetworkACL.DEFAULT_ALLOW) || (aclItem.getAclId() == NetworkACL.DEFAULT_DENY)){
throw new InvalidParameterValueException("ACL Items in default ACL cannot be deleted");
}
}
return _networkAclMgr.revokeNetworkACLItem(ruleId);
}