Skip to content

Commit e2805b8

Browse files
author
Kishan Kavala
committed
CLOUDSTACK-5145 : Added permission checks while deleting network ACLs
1 parent 6b7ea7f commit e2805b8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,14 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(ListNet
582582
public boolean revokeNetworkACLItem(long ruleId) {
583583
NetworkACLItemVO aclItem = _networkACLItemDao.findById(ruleId);
584584
if(aclItem != null){
585+
NetworkACL acl = _networkAclMgr.getNetworkACL(aclItem.getAclId());
586+
587+
Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId());
588+
589+
Account caller = CallContext.current().getCallingAccount();
590+
591+
_accountMgr.checkAccess(caller, null, true, vpc);
592+
585593
if((aclItem.getAclId() == NetworkACL.DEFAULT_ALLOW) || (aclItem.getAclId() == NetworkACL.DEFAULT_DENY)){
586594
throw new InvalidParameterValueException("ACL Items in default ACL cannot be deleted");
587595
}

0 commit comments

Comments
 (0)