Skip to content

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:

Screenshot_from_2022-06-24_18-49-44

How to set up and validate locally

  1. Enable Dependency Proxy in your group (it's enabled by default)
  2. Use the Dependency Proxy image prefix to store a Docker image in Dependency Proxy cache
  3. Visit Packages & Registries > Dependency Proxy as a user who is not Group Owner and you will see the dropdown

MR acceptance checklist

Edited by Pham Sy Minh

Merge request reports

Loading