Skip to content

BUG-ID: CLOUDSTACK-8483 - Private template not visible in project #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

sudhansu7
Copy link

added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.

Problem: Template created using createTemplte API within project context is not visible in project view.
Root Cause: CeateTemplate API does not have projectId parameter and hence it creates the template against the caller's account id.
Solution: A new parameter 'projectId' has been added to createTemplate command and the ownership is decided based on current user account and projectid.

added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
@asfbot
Copy link

asfbot commented May 30, 2015

cloudstack-pull-requests #277 SUCCESS
This pull request looks good

@karuturi
Copy link
Member

karuturi commented Jun 4, 2015

Do we really need projectId here? The api doc says "A template created from this command is automatically designated as a private template visible to the account that created it."

@@ -215,33 +221,39 @@ public long getEntityOwnerId() {
if (volumeId != null) {
Volume volume = _entityMgr.findById(Volume.class, volumeId);
if (volume != null) {
accountId = volume.getAccountId();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accountId is unused. Can we initialize it with CallContext.current().getCallingAccount() and use it (which saves some function calls)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make this change

@sebgoa
Copy link
Member

sebgoa commented Jul 2, 2015

@sudhansu7 can you reply to @karuturi ? thanks. Otherwise this will stay stuck waiting for your answer.

@sudhansu7
Copy link
Author

@karuturi
When a user switches to project view the ownership changes to project account. So any resource created inside project view should be mapped to project account.

added new 'projectId' parameter in createTemplate command and based
current user, account and projectid decide the owner of the template.
@kishankavala
Copy link
Contributor

There is an API change. Should this go into master only?

@@ -124,6 +127,9 @@
description = "true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
protected Boolean isDynamicallyScalable;

@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "create template for the project")
private Long projectId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping. Since, this is an append only API change. IMO we can merge on 4.5 as well.
Updates, is this good to go?

@DaanHoogland
Copy link
Contributor

@karuturi @kishankavala can you answer @bhaisaab or add your LGTM?

@karuturi
Copy link
Member

with the new changes, looks good to me 👍

@karuturi
Copy link
Member

@sudhansu7 can you please rebase the changes for master?

@asfgit asfgit closed this in 31b486d Jul 26, 2015
maneesha-p pushed a commit to maneesha-p/cloudstack that referenced this pull request Jul 31, 2015
RodrigoDLopez pushed a commit to RodrigoDLopez/cloudstack that referenced this pull request Aug 23, 2022
…louds'

Copy template to new storage pool when migrating volume

Closes apache#334

See merge request scclouds/scclouds!267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants