Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B500810C35 for ; Wed, 5 Jun 2013 09:32:36 +0000 (UTC) Received: (qmail 27442 invoked by uid 500); 5 Jun 2013 09:32:35 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 27361 invoked by uid 500); 5 Jun 2013 09:32:34 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 27352 invoked by uid 99); 5 Jun 2013 09:32:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 09:32:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8615F315583; Wed, 5 Jun 2013 09:32:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: muralireddy@apache.org To: commits@cloudstack.apache.org Message-Id: <91a054ac5baf4d4887f570ebcad6af4e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 91b1571 Date: Wed, 5 Jun 2013 09:32:33 +0000 (UTC) Updated Branches: refs/heads/master 52a901099 -> 91b15711b CLOUDSTACK-2343: listGlobalLoadBalancerRules shouldn't list the globalGSLBRules of other accounts imposing ACL checks Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/91b15711 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/91b15711 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/91b15711 Branch: refs/heads/master Commit: 91b15711b638f7ea604ef34cdfe60fcf845aec52 Parents: 52a9010 Author: Murali Reddy Authored: Wed Jun 5 15:01:09 2013 +0530 Committer: Murali Reddy Committed: Wed Jun 5 15:02:03 2013 +0530 ---------------------------------------------------------------------- .../gslb/GlobalLoadBalancingRulesServiceImpl.java | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/91b15711/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java ---------------------------------------------------------------------- diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java index 7c46d4a..483c19a 100644 --- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java +++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java @@ -528,6 +528,10 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR @Override public List listGlobalLoadBalancerRule(ListGlobalLoadBalancerRuleCmd listGslbCmd) { + + UserContext ctx = UserContext.current(); + Account caller = ctx.getCaller(); + Integer regionId = listGslbCmd.getRegionId(); Long ruleId = listGslbCmd.getId(); List response = new ArrayList(); @@ -546,12 +550,14 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR if (gslbRule == null) { throw new InvalidParameterValueException("Invalid gslb rule id specified"); } + _accountMgr.checkAccess(caller, org.apache.cloudstack.acl.SecurityChecker.AccessType.ListEntry, false, gslbRule); + response.add(gslbRule); return response; } if (regionId != null) { - List gslbRules = _gslbRuleDao.listByRegionId(regionId); + List gslbRules = _gslbRuleDao.listByAccount(caller.getAccountId()); if (gslbRules != null) { response.addAll(gslbRules); }