cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [1/2] git commit: updated refs/heads/4.3 to e2805b8
Date Mon, 16 Dec 2013 12:41:31 GMT
Updated Branches:
  refs/heads/4.3 6b7ea7f90 -> e2805b802
  refs/heads/master 7cac5aa9f -> 3a3fec3cb


CLOUDSTACK-5145 : Added permission checks while deleting network ACLs


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e2805b80
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e2805b80
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e2805b80

Branch: refs/heads/4.3
Commit: e2805b802cb7eb82bf885199e0bd289bcb599167
Parents: 6b7ea7f
Author: Kishan Kavala <kishan@cloud.com>
Authored: Mon Dec 16 17:50:08 2013 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Mon Dec 16 17:50:08 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2805b80/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index e91af57..6677338 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -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");
             }


Mime
View raw message