mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7394:Caller should be owner after creating template from
snapshot/volume.
This commit is contained in:
parent
b7f5e95c8f
commit
1436ce62b6
@ -266,7 +266,8 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd {
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
VirtualMachineTemplate template = null;
|
||||
template = _templateService.createPrivateTemplateRecord(this, _accountService.getAccount(getEntityOwnerId()));
|
||||
//TemplateOwner should be the caller https://issues.citrite.net/browse/CS-17530
|
||||
template = _templateService.createPrivateTemplateRecord(this, CallContext.current().getCallingAccount());
|
||||
if (template != null) {
|
||||
setEntityId(template.getId());
|
||||
setEntityUuid(template.getUuid());
|
||||
|
||||
@ -31,7 +31,6 @@ import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.utils.DateUtil;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
@ -160,6 +159,7 @@ import com.cloud.user.ResourceLimitService;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.utils.DateUtil;
|
||||
import com.cloud.utils.EnumUtils;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
@ -1361,7 +1361,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
||||
Long volumeId = command.getVolumeId();
|
||||
Long snapshotId = command.getSnapshotId();
|
||||
VMTemplateVO privateTemplate = null;
|
||||
final Long accountId = null;
|
||||
final Long accountId = CallContext.current().getCallingAccountId();
|
||||
SnapshotVO snapshot = null;
|
||||
VolumeVO volume = null;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user