mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5145 : Added permission checks while deleting network ACLs
This commit is contained in:
parent
6b7ea7f90d
commit
e2805b802c
|
|
@ -582,6 +582,14 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
|
|||
public boolean revokeNetworkACLItem(long ruleId) {
|
||||
NetworkACLItemVO aclItem = _networkACLItemDao.findById(ruleId);
|
||||
if(aclItem != null){
|
||||
NetworkACL acl = _networkAclMgr.getNetworkACL(aclItem.getAclId());
|
||||
|
||||
Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId());
|
||||
|
||||
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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue