|
19 | 19 | import org.apache.log4j.Logger; |
20 | 20 |
|
21 | 21 | import org.apache.cloudstack.acl.RoleType; |
| 22 | +import org.apache.cloudstack.acl.SecurityChecker.AccessType; |
22 | 23 | import org.apache.cloudstack.api.ACL; |
23 | 24 | import org.apache.cloudstack.api.APICommand; |
24 | 25 | import org.apache.cloudstack.api.ApiCommandJobType; |
|
42 | 43 | import com.cloud.exception.ResourceAllocationException; |
43 | 44 | import com.cloud.storage.Snapshot; |
44 | 45 | import com.cloud.storage.Volume; |
| 46 | +import com.cloud.vm.VirtualMachine; |
45 | 47 |
|
46 | | -@APICommand(name = "createVolume", responseObject = VolumeResponse.class, description = "Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.", responseView = ResponseView.Restricted, entityType = {Volume.class}, |
| 48 | +@APICommand(name = "createVolume", responseObject = VolumeResponse.class, description = "Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.", responseView = ResponseView.Restricted, entityType = { |
| 49 | + Volume.class, VirtualMachine.class}, |
47 | 50 | requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) |
48 | 51 | public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd { |
49 | 52 | public static final Logger s_logger = Logger.getLogger(CreateVolumeCmd.class.getName()); |
@@ -103,7 +106,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd { |
103 | 106 | @Parameter(name = ApiConstants.DISPLAY_VOLUME, type = CommandType.BOOLEAN, description = "an optional field, whether to display the volume to the end user or not.", authorized = {RoleType.Admin}) |
104 | 107 | private Boolean displayVolume; |
105 | 108 |
|
106 | | - @ACL |
| 109 | + @ACL(accessType = AccessType.OperateEntry) |
107 | 110 | @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, |
108 | 111 | type = CommandType.UUID, |
109 | 112 | entityType = UserVmResponse.class, |
|
0 commit comments