-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Show menu section if user has access to at least one of its pages #8978
Show menu section if user has access to at least one of its pages #8978
Conversation
@blueorangutan package |
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@BryanMLima a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
UI build: ✔️ |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9429 |
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.
LGTM, I've manually tested the PR in the QA environment.
- I created a role based on the
User
role. - I denied the role's access to
listNetworks
andlistVolumesMetrics
APIs. - I created an account using the custom role.
- I checked that the Storage and Network sections and their subsections are being displayed correctly.
Great fix, @winterhazel!
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
UI build: ✔️ |
@winterhazel @bernardodemarco I tried this in qa:
to double check I created a "regular" Read-Only user and could log in. |
Hey @DaanHoogland, I reproduced your steps in QA and was able to log in. I created the account I suppose that the user you created was |
you are right, I added |
Description
As reported in #8713 (comment), the Storage section in the sidebar is not displayed to users when they do not have permission to the API
listVolumesMetrics
. However, roles can have permissions to other APIs, such aslistBackups
andlistSnapshots
, in which case the section should be displayed. This situation is not exclusive to the Storage section.This PR fixes this issue by changing how the routes are filtered. Now, sections will be shown if they have at least one visible child. For other routes, the previous logic is still applied.
Closes #8730.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
Here's how the menu looks like before (left) and after the changes (right) for a user that does not have permission for
listVolumesMetrics
:How Has This Been Tested?
v
, based on the roleUser
, that had access tolistSnapshots
andlistBuckets
, but did not have tolistVolumesMetrics
;v
using rolev
;v
;listSnaphots
andlistBuckets
for rolev
;