Fixed ipAssoc and createNetworkACL (for vpc) commands - didn't work in Project scenario

Conflicts:

	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
This commit is contained in:
Alena Prokharchyk 2012-10-04 12:11:37 -07:00
parent 43b406279a
commit 823f0c9669
3 changed files with 7 additions and 4 deletions

View File

@ -1142,7 +1142,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
Network network = _networksDao.findById(networkId);
if (network != null) {
_accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
_accountMgr.checkAccess(owner, AccessType.UseNetwork, false, network);
} else {
s_logger.debug("Unable to find ip address by id: " + ipId);
return null;

View File

@ -137,8 +137,11 @@ public class NetworkACLManagerImpl implements Manager,NetworkACLManager{
Vpc vpc = _vpcMgr.getVpc(network.getVpcId());
Account aclOwner = _accountMgr.getAccount(vpc.getAccountId());
_accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
//check if the caller can access vpc
_accountMgr.checkAccess(caller, null, false, vpc);
//check if the acl can be created for this network
_accountMgr.checkAccess(aclOwner, AccessType.UseNetwork, false, network);
if (!_networkMgr.areServicesSupportedInNetwork(networkId, Service.NetworkACL)) {
throw new InvalidParameterValueException("Service " + Service.NetworkACL + " is not supported in network " + network);

View File

@ -1263,7 +1263,7 @@ public class ManagementServerImpl implements ManagementServer {
boolean listAll = false;
if (isoFilter != null && isoFilter == TemplateFilter.all) {
if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only", null);
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");
}
listAll = true;
}
@ -1292,7 +1292,7 @@ public class ManagementServerImpl implements ManagementServer {
boolean listAll = false;
if (templateFilter != null && templateFilter == TemplateFilter.all) {
if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only", null);
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");
}
listAll = true;
}