Merge branch '4.16'

This commit is contained in:
nvazquez 2022-03-06 10:08:35 -03:00
commit cb872ab6bd
No known key found for this signature in database
GPG Key ID: 656E1BCC8CB54F84

View File

@ -1336,9 +1336,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new CloudRuntimeException("Zone " + vmInstance.getDataCenterId() + ", has a NetworkType of Basic. Can't add a new NIC to a VM on a Basic Network");
}
// Perform account permission check on network
_accountMgr.checkAccess(caller, AccessType.UseEntry, false, network);
//ensure network belongs in zone
if (network.getDataCenterId() != vmInstance.getDataCenterId()) {
throw new CloudRuntimeException(vmInstance + " is in zone:" + vmInstance.getDataCenterId() + " but " + network + " is in zone:" + network.getDataCenterId());
@ -3524,6 +3521,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("Network is not security group enabled: " + network.getId());
}
_accountMgr.checkAccess(owner, AccessType.UseEntry, false, network);
networkList.add(network);
}
isSecurityGroupEnabledNetworkUsed = true;
@ -3546,10 +3545,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("Can specify only Shared Guest networks when" + " deploy vm in Advance Security Group enabled zone");
}
// Perform account permission check
if (network.getAclType() == ACLType.Account) {
_accountMgr.checkAccess(caller, AccessType.UseEntry, false, network);
}
_accountMgr.checkAccess(owner, AccessType.UseEntry, false, network);
networkList.add(network);
}
}