Add user_permissions field to ContainerRepository/Tag type
What does this MR do and why?
This MR adds the new user_permissions
fields to ContainerRepositoryType
and ContainerRepositoryTagType
that will supersede existing can_delete
field. And also marks existing can_delete
field as deprecated.
The deprecation issue Deprecate canDelete fields of ContainerReposito... (#432238)
Screenshots or screen recordings
How to set up and validate locally
-
Get the
ID
of existingContainerRepository
in rails console.r = ContainerRepository.last r.id
-
Login as a
root
user and visit http://gdk.test:3000/-/graphql-explorer and create a graphql query. The response should containuserPermissions
field forcontainerRepository
and each tag.query { containerRepository(id: "gid://gitlab/ContainerRepository/<Container Repository ID>") { canDelete userPermissions { destroyContainerRepository } tags { edges { node { canDelete userPermissions { destroyContainerRepositoryTag } } } } } }
Note: that
destroyContainerRepository
anddestroyContainerRepositoryTag
fields have the same value as correspondingcanDelete
field. In case ofroot
user they should betrue
. -
Logout and login as an user with a role
reporter
(make sure that this user has an access to a project, linked to the requested container repository.query { containerRepository(id: "gid://gitlab/ContainerRepository/<Container Repository ID>") { canDelete userPermissions { destroyContainerRepository } tags { edges { node { canDelete userPermissions { destroyContainerRepositoryTag } } } } } }
Note: now
destroyContainerRepository
anddestroyContainerRepositoryTag
fields should befalse
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #390754 (closed)