Do not display 'Clear cache' dropdown when user isn't permitted to do it
What does this MR do and why?
According to the documentation (also tested and confirmed on Gitlab.com), only Group Owners can clear the Dependency Proxy cache. However, the Clear cache dropdown is still shown in the UI to users with inappropriate permission.
This MR addresses the issue above
Closes #363270 (closed)
Screenshots or screen recordings
The dropdown is rendered:
But the action is denied:
How to set up and validate locally
- Enable Dependency Proxy in your group (it's enabled by default)
- Use the Dependency Proxy image prefix to store a Docker image in Dependency Proxy cache
- Visit Packages & Registries > Dependency Proxy as a user who is not Group Owner and you will see the dropdown
MR acceptance checklist
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Pham Sy Minh