Fix compilation error due to cherry-pick CLOUDSTACK-6569. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7f595778 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7f595778 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7f595778
Branch: refs/heads/master Commit: 7f595778ada00bbe607516bd9630976a4113098e Parents: 3314e11 Author: Min Chen <[email protected]> Authored: Fri May 2 16:01:13 2014 -0700 Committer: Min Chen <[email protected]> Committed: Fri May 2 16:01:13 2014 -0700 ---------------------------------------------------------------------- .../com/cloud/storage/VolumeApiServiceImpl.java | 3 --- .../cloud/storage/VolumeApiServiceImplTest.java | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f595778/server/src/com/cloud/storage/VolumeApiServiceImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index a0315c0..8758e72 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1093,9 +1093,6 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic throw new InvalidParameterValueException("Please specify a VM that is in the same zone as the volume."); } - // permission check - _accountMgr.checkAccess(caller, null, true, volumeToAttach, vm); - // Check that the device ID is valid if (deviceId != null) { // validate ROOT volume type http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f595778/server/test/com/cloud/storage/VolumeApiServiceImplTest.java ---------------------------------------------------------------------- diff --git a/server/test/com/cloud/storage/VolumeApiServiceImplTest.java b/server/test/com/cloud/storage/VolumeApiServiceImplTest.java index b7d041d..68931a1 100644 --- a/server/test/com/cloud/storage/VolumeApiServiceImplTest.java +++ b/server/test/com/cloud/storage/VolumeApiServiceImplTest.java @@ -27,6 +27,15 @@ import java.util.UUID; import javax.inject.Inject; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; + import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd; @@ -39,14 +48,6 @@ import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao; import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; import com.cloud.exception.InvalidParameterValueException; import com.cloud.hypervisor.Hypervisor.HypervisorType; @@ -232,7 +233,7 @@ public class VolumeApiServiceImplTest { } // helper methods mock - doNothing().when(_svc._accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(Boolean.class), any(ControlledEntity.class)); + doNothing().when(_svc._accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(ControlledEntity.class)); doNothing().when(_svc._jobMgr).updateAsyncJobAttachment(any(Long.class), any(String.class), any(Long.class)); when(_svc._jobMgr.submitAsyncJob(any(AsyncJobVO.class), any(String.class), any(Long.class))).thenReturn(1L); }
