Skip to content

Use user_permissions field for container registry

Rahul Chanila requested to merge 390754-container-registry-user-permissions into master

What does this MR do and why?

Use user_permissions field for container registry

Removes usage of canDelete & replaced with destroyContainerRepository & destroyContainerRepositoryTag. This was deprecated in Deprecation: 2 package graphql fields (!136272 - merged)

The user_permissions was added in Add user_permissions field to ContainerReposito... (!136576 - merged)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No changes

How to set up and validate locally

Images list

  1. Setup & enable Container Registry https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/registry.md

  2. Follow steps in https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/wikis/Packages-Tips-&-Tricks#how-to-add-images-with-tags-quickly-to-the-registry

  3. To see pagination, run the following in the terminal

    $ ./publish.sh <project-path> 2 10 127.0.0.1:5000 # creates 10 images with 2 tags each
  4. Visit the container registry list page for the project

  5. Confirm the GraphQL query requests for userPermissions field & does not request canDelete field.

  6. Confirm that users with maintainer, owner & admin permissions can delete images. Confirm that guest, reporter cannot delete images

Tags list

  1. After following previous instructions, visit the container registry list page for the project
  2. Clicking one of the images should take you the tags list(details) page
  3. Confirm the GraphQL query requests for userPermissions field & does not request canDelete field.
  4. Confirm that users with maintainer, owner & admin permissions can delete image tags. Confirm that guest, reporter cannot delete image tags.

Related to #390754 (closed)

Edited by Rahul Chanila

Merge request reports