2020-11-10 21:08:51 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
class ContainerRepositoryTagType < BaseObject
|
|
|
|
graphql_name 'ContainerRepositoryTag'
|
|
|
|
|
|
|
|
description 'A tag from a container repository'
|
|
|
|
|
|
|
|
authorize :read_container_image
|
|
|
|
|
2022-03-01 18:20:20 +00:00
|
|
|
field :can_delete, GraphQL::Types::Boolean, null: false, description: 'Can the current user delete this tag.'
|
|
|
|
field :created_at, Types::TimeType, null: true, description: 'Timestamp when the tag was created.'
|
|
|
|
field :digest, GraphQL::Types::String, null: true, description: 'Digest of the tag.'
|
|
|
|
field :location, GraphQL::Types::String, null: false, description: 'URL of the tag.'
|
2021-07-26 12:10:08 +00:00
|
|
|
field :name, GraphQL::Types::String, null: false, description: 'Name of the tag.'
|
|
|
|
field :path, GraphQL::Types::String, null: false, description: 'Path of the tag.'
|
|
|
|
field :revision, GraphQL::Types::String, null: true, description: 'Revision of the tag.'
|
|
|
|
field :short_revision, GraphQL::Types::String, null: true, description: 'Short revision of the tag.'
|
2021-08-19 18:10:32 +00:00
|
|
|
field :total_size, GraphQL::Types::BigInt, null: true, description: 'Size of the tag.'
|
2020-11-10 21:08:51 +00:00
|
|
|
|
|
|
|
def can_delete
|
|
|
|
Ability.allowed?(current_user, :destroy_container_image, object)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|