S2S VPN: CS-15882: Only allow VPN connection between same account's gateways

This commit is contained in:
Sheng Yang 2012-08-07 11:40:48 -07:00
parent ff708a87d3
commit acd9f4887f
1 changed files with 4 additions and 0 deletions

View File

@ -228,6 +228,10 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager {
throw new InvalidParameterValueException("Unable to find specified Site to Site VPN gateway by id", null);
}
_accountMgr.checkAccess(caller, null, false, vpnGateway);
if (customerGateway.getAccountId() != vpnGateway.getAccountId() || customerGateway.getDomainId() != vpnGateway.getAccountId()) {
throw new InvalidParameterValueException("VPN connection can only be esitablished between same account's VPN gateway and customer gateway!", null);
}
if (_vpnConnectionDao.findByVpnGatewayIdAndCustomerGatewayId(vpnGatewayId, customerGatewayId) != null) {
List<IdentityProxy> idList = new ArrayList<IdentityProxy>();