CLOUDSTACK-2477: [GSLB] CloudStack currently allows admin to map LB rule

of one account to GSLB rule of a different account

ensuring account id of GSLB rule and LB rule are same
This commit is contained in:
Murali Reddy 2013-05-29 17:01:54 +05:30
parent 2b93969823
commit c8a0c40a2f
1 changed files with 4 additions and 0 deletions

View File

@ -204,6 +204,10 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
_accountMgr.checkAccess(caller, null, true, loadBalancer);
if (gslbRule.getAccountId() != loadBalancer.getAccountId()) {
throw new InvalidParameterValueException("GSLB rule and load balancer rule does not belong to same account");
}
if (loadBalancer.getState() == LoadBalancer.State.Revoke) {
throw new InvalidParameterValueException("Load balancer ID " + loadBalancer.getUuid() + " is in revoke state");
}