mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
@ACL from some commands
This commit is contained in:
parent
13e25d2aae
commit
f0a9b3b510
@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.vmsnapshot;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
@ -43,6 +45,7 @@ public class RevertToVMSnapshotCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(RevertToVMSnapshotCmd.class.getName());
|
||||
private static final String s_name = "reverttovmsnapshotresponse";
|
||||
|
||||
@ACL(accessType = AccessType.OperateEntry, pointerToEntity = "getVmId()")
|
||||
@Parameter(name = ApiConstants.VM_SNAPSHOT_ID,
|
||||
type = CommandType.UUID,
|
||||
required = true,
|
||||
|
||||
@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.vpn;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.acl.AclEntityType;
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
@ -41,6 +43,7 @@ public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@ACL(accessType = AccessType.OperateEntry)
|
||||
@Parameter(name = ApiConstants.ID,
|
||||
type = CommandType.UUID,
|
||||
entityType = Site2SiteCustomerGatewayResponse.class,
|
||||
|
||||
@ -25,13 +25,16 @@ import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListRemoteAccessVpnsCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListVpnUsersCmd;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
import org.apache.cloudstack.framework.config.Configurable;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.configuration.Config;
|
||||
import com.cloud.domain.DomainVO;
|
||||
@ -286,7 +289,7 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements RemoteAcc
|
||||
return;
|
||||
}
|
||||
|
||||
_accountMgr.checkAccess(caller, null, true, vpn);
|
||||
_accountMgr.checkAccess(caller, AccessType.OperateEntry, true, vpn);
|
||||
|
||||
vpn.setState(RemoteAccessVpn.State.Removed);
|
||||
_remoteAccessVpnDao.update(vpn.getId(), vpn);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user