@ACL from some commands

This commit is contained in:
Prachi Damle 2014-02-07 14:36:55 -08:00
parent 13e25d2aae
commit f0a9b3b510
3 changed files with 11 additions and 2 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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);