Skip to content

Templates owned by Project Account not allowed to share templates #7350

Closed

Description

@damonb123
ISSUE TYPE
  • Bug Report
COMPONENT NAME
API
CLOUDSTACK VERSION
4.17.1.0
4.17.2.0
public boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissionsCmd cmd) {

      <...>

        if (owner.getType() == Account.Type.PROJECT) {
            // Currently project owned templates cannot be shared outside project but is available to all users within project by default.
            throw new InvalidParameterValueException("Update template permissions is an invalid operation on template " + template.getName() +
                    ". Project owned templates cannot be shared outside template.");
        }

      <...>
SUMMARY

Templates owned by a project account are not allowed to exectute updateTemplatePermissions API.
This prevents projects from sharing templates between them selves that are in the same Domain as stated by the API docs.
It seems to indicate that only templates created by a users in the "admin" or other non-project group are allowed to mark templates shared outside of the project structure.

EXPECTED RESULTS

Allowing users in the same domain to share templates would seem to be an expected behavior.

Activity

  1. kiranchavala commented on Mar 20, 2023

    @kiranchavala
    Member

    Hi @damonb123

    Could you please let me know what's role typer of the account

    1. The account type you created (domain-admin , user, etc)

    account type

    1. What is the project role type you selected , when adding account to the project

    project- type

  2. shwstppr commented on Apr 6, 2023

    @shwstppr
    Contributor

    @weizhouapache @rohityadavcloud @harikrishna-patnala does it make sense to allow ROOT admin to change the owner of the templates using updateTemplate API?
    Or should we allow project-owned templates to be shared outside the project?

  3. added this to the 4.19.0.0 milestone on Jun 22, 2023
  4. modified the milestones: 4.19.0.0, 4.19.1.0 on Dec 14, 2023
  5. yadvr commented on Apr 30, 2024

    @yadvr
    Member

    This is by design, template registered in a project are owned by it so not accessible to others. However, like any account they should be allowed to be shared to others.

  6. moved this from Todo to Dev In Progress in Apache CloudStack BugFest - Issueson Jun 10, 2024
  7. self-assigned this
    on Jun 10, 2024
  8. moved this from Dev In Progress to Discuss in Apache CloudStack BugFest - Issueson Jun 11, 2024
  9. DaanHoogland commented on Jun 11, 2024

    @DaanHoogland
    Contributor

    I added a simple change in #9196 . A domain admin can share with the PR at least. Normal users never own their own template in a project as it belongs to the project account. I am not sure if this is as intended, but it seems some extra work is needed.

  10. moved this from Discuss to Dev In Progress in Apache CloudStack BugFest - Issueson Jun 11, 2024
  11. DaanHoogland commented on Jun 14, 2024

    @DaanHoogland
    Contributor

    @kiranchavala @rohityadavcloud @damonb123 , My take on this is that if the user has access to the template thay can adjust the sharing rights as well. I do not have clear yet if there should be some restrictions to what they can do, beyond what is programmatically possible at this moment. I.E. are restrictions and extra checks needed?

  12. moved this from Dev In Progress to Discuss in Apache CloudStack BugFest - Issueson Jun 14, 2024
  13. DaanHoogland commented on Jun 19, 2024

    @DaanHoogland
    Contributor

    @damonb123 #9196 implements your request . as @vishesh92 shows in #9196 (comment) this is not much help yet for UI users but may help you if you want to share for use in the API. I will look at a furhter UI fix.

  14. DaanHoogland commented on Jun 21, 2024

    @DaanHoogland
    Contributor

    fixed in #9196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions