mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Fix the type of the id attribute in BaseAsyncCmd (it should be Long), deleteNetworkRuleConfig is async command again (this was a regression), misc event and account verification fixes
This commit is contained in:
parent
136060e5cf
commit
24bd6a39e6
@ -37,7 +37,7 @@ public class AssignPortForwardingServiceCmd extends BaseAsyncCmd {
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name="id", type=CommandType.STRING)
|
||||
@Parameter(name="id", type=CommandType.LONG)
|
||||
private Long id;
|
||||
|
||||
@Parameter(name="ids", type=CommandType.LIST, collectionType=CommandType.LONG)
|
||||
|
||||
@ -20,14 +20,14 @@ package com.cloud.api.commands;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd.Manager;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
|
||||
@Implementation(method="deleteNetworkRuleConfig", manager=Manager.NetworkManager)
|
||||
public class DeletePortForwardingServiceRuleCmd extends BaseCmd {
|
||||
public class DeletePortForwardingServiceRuleCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeletePortForwardingServiceRuleCmd.class.getName());
|
||||
|
||||
private static final String s_name = "deleteportforwardingserviceruleresponse";
|
||||
|
||||
@ -3624,14 +3624,14 @@ public class NetworkManagerImpl implements NetworkManager, VirtualMachineManager
|
||||
NetworkRuleConfigVO netRule = _networkRuleConfigDao.findById(netRuleId);
|
||||
if (netRule != null) {
|
||||
SecurityGroupVO sg = _securityGroupDao.findById(netRule.getSecurityGroupId());
|
||||
if (account != null) {
|
||||
if (!BaseCmd.isAdmin(account.getType())) {
|
||||
if (sg.getAccountId() != account.getId()) {
|
||||
throw new PermissionDeniedException("Unable to delete port forwarding service rule " + netRuleId + "; account: " + account.getAccountName() + " is not the owner");
|
||||
}
|
||||
} else if (!_domainDao.isChildDomain(account.getDomainId(), sg.getDomainId())) {
|
||||
if ((account == null) || BaseCmd.isAdmin(account.getType())) {
|
||||
if ((account != null) && !_domainDao.isChildDomain(account.getDomainId(), sg.getDomainId())) {
|
||||
throw new PermissionDeniedException("Unable to delete port forwarding service rule " + netRuleId + "; account: " + account.getAccountName() + " is not an admin in the domain hierarchy.");
|
||||
}
|
||||
} else {
|
||||
if (sg.getAccountId() != account.getId()) {
|
||||
throw new PermissionDeniedException("Unable to delete port forwarding service rule " + netRuleId + "; account: " + account.getAccountName() + " is not the owner");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false; // failed to delete due to netRule not found
|
||||
|
||||
@ -2210,7 +2210,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
String description = "created new ip forwarding rule [" + newFwRule.getPublicIpAddress() + ":" + newFwRule.getPublicPort() + "]->["
|
||||
+ newFwRule.getPrivateIpAddress() + ":" + newFwRule.getPrivatePort() + "]" + " " + newFwRule.getProtocol();
|
||||
|
||||
EventUtils.saveEvent(userId, account.getId(), EventVO.LEVEL_INFO, EventTypes.EVENT_NET_RULE_ADD, description);
|
||||
EventUtils.saveEvent(userId, userVm.getId(), EventVO.LEVEL_INFO, EventTypes.EVENT_NET_RULE_ADD, description);
|
||||
}
|
||||
|
||||
// now that individual rules have been created from the security group, save the security group mapping for this ip/vm instance
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user