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 |
bernardodemarco
left a comment
There was a problem hiding this comment.
LGTM, I've manually tested the PR in the QA environment.
- I created a role based on the
Userrole. - I denied the role's access to
listNetworksandlistVolumesMetricsAPIs. - 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 aslistBackupsandlistSnapshots, 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 tolistSnapshotsandlistBuckets, but did not have tolistVolumesMetrics;vusing rolev;v;listSnaphotsandlistBucketsfor rolev;