CLOUDSTACK-2686 Upload volume to project is not shown in project storage view

This commit is contained in:
Mice Xia 2013-05-27 15:47:56 +08:00
parent a16b707250
commit cc2866c1ea
1 changed files with 7 additions and 1 deletions

View File

@ -22,7 +22,9 @@ import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.BaseCmd.CommandType;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
@ -72,6 +74,10 @@ public class UploadVolumeCmd extends BaseAsyncCmd {
description="Image store uuid")
private String imageStoreUuid;
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
description="Upload volume for the project")
private Long projectId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -135,7 +141,7 @@ public class UploadVolumeCmd extends BaseAsyncCmd {
@Override
public long getEntityOwnerId() {
Long accountId = finalyzeAccountId(accountName, domainId, null, true);
Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
if (accountId == null) {
return UserContext.current().getCaller().getId();
}