Class: Types::ContainerRepositoryDetailsType

Inherits:
ContainerRepositoryType show all
Defined in:
app/graphql/types/container_repository_details_type.rb

Instance Method Summary collapse

Methods inherited from ContainerRepositoryType

#project, #tags_count

Methods inherited from BaseObject

accepts, assignable?, authorization, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#can_deleteObject


23
24
25
# File 'app/graphql/types/container_repository_details_type.rb', line 23

def can_delete
  Ability.allowed?(current_user, :destroy_container_image, object)
end

#sizeObject


27
28
29
30
31
# File 'app/graphql/types/container_repository_details_type.rb', line 27

def size
  object.size
rescue Faraday::Error
  raise ::Gitlab::Graphql::Errors::ResourceNotAvailable, "Can't connect to the Container Registry. If this error persists, please review the troubleshooting documentation."
end