Skip to content

Hide bulk deletion UI of container tags for users without permission

What does this MR do and why?

On the container image tags page, the checkbox to select image tags and Delete selected button are visible and appears as if bulk deletion is possible when user does not have permission.

For users without permission to delete images, this MR passes the hiddenDelete prop to shared registry-list component to hide bulk deletion UI of container tags

It also right aligns the publish date content in above scenario.

Screenshots or screen recordings

As user without permission (before): Screenshot_2023-03-06_at_11.32.36_pm

As user without permission (after): Screenshot_2023-03-06_at_3.29.56_pm

As user with permission (no change):

Screenshot_2023-03-06_at_3.30.09_pm

How to set up and validate locally

  1. Choose a public project
  2. Setup & enable Container Registry https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/registry.md
  3. Add a few images with tags by following https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/wikis/Packages-Tips-&-Tricks#how-to-add-images-with-tags-quickly-to-the-registry
  4. Visit the container registry list page for the project
  5. clicking one of the images should take you the tags list page
  6. Bulk deletion UI should be visible
  7. Copy the tags list URL and visit the URL in an incognito tab
  8. As a non-logged in user, should not be able to see the bulk deletion selection and also contents should be right-aligned.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #388073 (closed)

Edited by Rahul Chanila

Merge request reports