Add user_permissions fields to PackageType and PackageDetailsType
requested to merge 390754-migrate-packages-and-registries-graphql-to-add-userpermissions-field into master
What does this MR do and why?
This MR adds the new user_permissions
fields to PackageType
and PackageDetailsType
that will supersede existing can_destroy
field. And also marks existing can_destroy
field as deprecated.
Screenshots or screen recordings
How to set up and validate locally
Run the following steps in rails console.
-
Create a new package.
def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end p = FactoryBot.create(:npm_package) p.id # We will need the package's ID in the next step
-
Visit http://gdk.test:3000/-/graphql-explorer and create a graphql query. The response should contain
userPermissions
field.query { package(id: "gid://gitlab/Packages::Package/<package_id>") { userPermissions { destroyPackage } } }
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)
Edited by Dzmitry (Dima) Meshcharakou