Fixed deployVm for regular user - he couldn't use zone wide networks

This commit is contained in:
Alena Prokharchyk 2011-12-14 16:17:08 -08:00
parent c53fee2911
commit 8674444cb9

View File

@ -1112,6 +1112,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
if (related == -1) {
related = id;
}
Transaction txn = Transaction.currentTxn();
txn.start();
NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(), related, name, displayText, predefined.getNetworkDomain(),
offering.getGuestType(), plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType);
@ -1120,6 +1123,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
if (domainId != null && aclType == ACLType.Domain) {
_networksDao.addDomainToNetwork(id, domainId, subdomainAccess);
}
txn.commit();
}
if (networks.size() < 1) {
@ -1808,6 +1813,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
_accountMgr.checkAccess(caller, domain);
}
isDomainSpecific = true;
} else if (subdomainAccess != null) {
throw new InvalidParameterValueException("Parameter subDomainAccess can be specified only with aclType=Domain");
}
@ -1886,6 +1892,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
sharedDomainId = domainId;
} else {
sharedDomainId = _domainMgr.getDomain(Domain.ROOT_DOMAIN).getId();
subdomainAccess = true;
}
}