diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/graphql/types/container_repository_type.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/graphql/types/container_repository_type.rb')
-rw-r--r-- | app/graphql/types/container_repository_type.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/graphql/types/container_repository_type.rb b/app/graphql/types/container_repository_type.rb new file mode 100644 index 00000000000..45d19fdbc50 --- /dev/null +++ b/app/graphql/types/container_repository_type.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Types + class ContainerRepositoryType < BaseObject + graphql_name 'ContainerRepository' + + description 'A container repository' + + authorize :read_container_image + + field :id, GraphQL::ID_TYPE, null: false, description: 'ID of the container repository.' + field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the container repository.' + field :path, GraphQL::STRING_TYPE, null: false, description: 'Path of the container repository.' + field :location, GraphQL::STRING_TYPE, null: false, description: 'URL of the container repository.' + field :created_at, Types::TimeType, null: false, description: 'Timestamp when the container repository was created.' + field :updated_at, Types::TimeType, null: false, description: 'Timestamp when the container repository was updated.' + field :expiration_policy_started_at, Types::TimeType, null: true, description: 'Timestamp when the cleanup done by the expiration policy was started on the container repository.' + field :expiration_policy_cleanup_status, Types::ContainerRepositoryCleanupStatusEnum, null: true, description: 'The tags cleanup status for the container repository.' + field :status, Types::ContainerRepositoryStatusEnum, null: true, description: 'Status of the container repository.' + field :tags_count, GraphQL::INT_TYPE, null: false, description: 'Number of tags associated with this image.' + field :can_delete, GraphQL::BOOLEAN_TYPE, null: false, description: 'Can the current user delete the container repository.' + + def can_delete + Ability.allowed?(current_user, :update_container_image, object) + end + end +end |