-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
cloudstack-pull-requests #277 SUCCESS |
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(); |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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
@sudhansu7 can you reply to @karuturi ? thanks. Otherwise this will stay stuck waiting for your answer. |
@karuturi |
added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
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; |
There was a problem hiding this comment.
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?
@karuturi @kishankavala can you answer @bhaisaab or add your LGTM? |
with the new changes, looks good to me 👍 |
@sudhansu7 can you please rebase the changes for master? |
…louds' Copy template to new storage pool when migrating volume Closes apache#334 See merge request scclouds/scclouds!267
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.