Skip to content

fix: only show valid organizations in CreateTemplateForm #14174

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

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Aug 5, 2024

Closes #14004

Hide any organizations that the user might have view permissions for, but not permission to create a template

aslilac added 2 commits August 5, 2024 19:12
hide any organizations that the user might have view permissions for, but not permission to create a template
Copy link

alwaysmeticulous bot commented Aug 5, 2024

🤖 Meticulous spotted visual differences in 82 of 735 screens tested: view and approve differences detected.

Last updated for commit 37b84eb. This comment will update as new commits are pushed.

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

Permission LG 👍

{
   "object":{
      "resource_type":"template",
      "organization_id:" <org_id>
   },
   "action":"create"
}

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

Code looks good. I just have one minor question. Going to QA this right now 👀

@BrunoQuaresma
Copy link
Collaborator

@aslilac @Emyrk I think I found a bug with permissions. After creating a new user and adding this user into an org as admin, this user is not able to do anything related to templates.

Screen.Recording.2024-08-06.at.12.51.31.mov

@Emyrk
Copy link
Member

Emyrk commented Aug 6, 2024

@aslilac @Emyrk I think I found a bug with permissions. After creating a new user and adding this user into an org as admin, this user is not able to do anything related to templates.

Screen.Recording.2024-08-06.at.12.51.31.mov

You are right, it is this call: http://localhost:3000/api/v2/organizations/default/templates/examples. Basically, an org-admin can make templates, and for some reason we query for the default template examples on the /templates page.

But we only query it for the primary org, which is going to fail for the org-admin in the second org.

@aslilac aslilac merged commit 3b53f5a into main Aug 6, 2024
34 checks passed
@aslilac aslilac deleted the check-create-template-permissions branch August 6, 2024 18:10
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants