Skip to content
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

Account Details - "View Templates" Button Does Not Filter #10391

Open
scottsignal opened this issue Feb 13, 2025 · 5 comments · May be fixed by #10425
Open

Account Details - "View Templates" Button Does Not Filter #10391

scottsignal opened this issue Feb 13, 2025 · 5 comments · May be fixed by #10425

Comments

@scottsignal
Copy link

scottsignal commented Feb 13, 2025

problem

Clicking on View Templates from Account Details as Root Admin does not filter correctly by Domain/Account.

Image

Expecting to only see 2 templates:
Image

versions

4.19.1.3 & 4.20.0.0
GUI
KVM

The steps to reproduce the bug

  1. Logged in as Root Admin click on Accounts
  2. Choose an account with the type DomainAdmin that is in a Sub-Domain (Note: this Sub-Domain should have its own templates)
  3. Click on the View Templates Button
  4. Observe the returned results are not for just that account. There is no filtering done.
    ...

What to do about it?

It appears that templatefilter is a required field for ListTemplates. If I add &templatefilter=self to my URL, the filtering then works correctly.

Image

@DaanHoogland
Copy link
Contributor

@scottsignal , I'm pretty sure this is as intended, meaning the root admin seeing all templates by default. I am not saying this shouldn't change but that someone did this on purpose and we need to take care to not break other use cases. cc @bernardodemarco

@bernardodemarco
Copy link
Collaborator

@DaanHoogland, I don't think that's the case here.

When the administrator access an account's page and selects the View Templates button, in my point of view, it would be expected the UI to return all templates registered by the given account. If someone did this on purpose, then I think that the URL that the UI redirects the user to would not contain the domainid and account query strings, right?

When those fields are defined but templatefilter is not, then the UI sends by default the request to the API with templateFilter set to all. As a consequence of that, all templates are returned, and the administrator is not able to filter templates by accounts through the UI.

It is important to note that the root admin will still continue seeing all templates by default when directly accessing the Templates page. This filtering will only be performed when the View Templates button of an account's page is selected.

@Pearl1594 Pearl1594 added this to the 4.19.3 milestone Feb 14, 2025
@bernardodemarco
Copy link
Collaborator

@DaanHoogland, what should we do about this one? Should we leave the way it is currently implemented or should we fix it? cc @Pearl1594

@DaanHoogland
Copy link
Contributor

see my answer at #10392 (comment) as well. If we can add a filter and the default view for root admin is still to view all, we can add the filter during the redirect from account view. This makes total functional sense to me.

@bernardodemarco
Copy link
Collaborator

see my answer at #10392 (comment) as well. If we can add a filter and the default view for root admin is still to view all, we can add the filter during the redirect from account view. This makes total functional sense to me.

Okay, great. Soon, I'll open a PR adding the filter when redirecting from the account view.

@bernardodemarco bernardodemarco linked a pull request Feb 18, 2025 that will close this issue
12 tasks
@DaanHoogland DaanHoogland linked a pull request Feb 20, 2025 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment