Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-10-31 12:12:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-31 12:12:13 +0300
commit6a5ef9b75d38f39cd2a6a2392fadfbd3b966b884 (patch)
tree56d7c715f2e312cb0ae47439385f2a6cba6fea5e /app
parent01cc900e7cc64797e39a7889032325d8c32bfe46 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/graphql/types/packages/package_base_type.rb10
-rw-r--r--app/graphql/types/permission_types/package.rb12
2 files changed, 21 insertions, 1 deletions
diff --git a/app/graphql/types/packages/package_base_type.rb b/app/graphql/types/packages/package_base_type.rb
index aa580d48709..5102e4ebcd5 100644
--- a/app/graphql/types/packages/package_base_type.rb
+++ b/app/graphql/types/packages/package_base_type.rb
@@ -10,11 +10,19 @@ module Types
authorize :read_package
+ expose_permissions Types::PermissionTypes::Package
+
field :id, ::Types::GlobalIDType[::Packages::Package], null: false, description: 'ID of the package.'
field :_links, Types::Packages::PackageLinksType, null: false, method: :itself,
description: 'Map of links to perform actions on the package.'
- field :can_destroy, GraphQL::Types::Boolean, null: false, description: 'Whether the user can destroy the package.'
+ field :can_destroy, GraphQL::Types::Boolean,
+ null: false,
+ deprecated: {
+ reason: 'Superseded by `user_permissions` field. See `Types::PermissionTypes::Package` type',
+ milestone: '16.6'
+ },
+ description: 'Whether the user can destroy the package.'
field :created_at, Types::TimeType, null: false, description: 'Date of creation.'
field :metadata, Types::Packages::MetadataType,
null: true,
diff --git a/app/graphql/types/permission_types/package.rb b/app/graphql/types/permission_types/package.rb
new file mode 100644
index 00000000000..debde3a1a8e
--- /dev/null
+++ b/app/graphql/types/permission_types/package.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module Types
+ module PermissionTypes
+ class Package < BasePermissionType
+ graphql_name 'PackagePermissions'
+
+ ability_field :destroy_package,
+ description: 'If `true`, the user can perform `destroy_package` on this resource'
+ end
+ end
+end