Class: Projects::ContainerRepository::DeleteTagsService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/projects/container_repository/delete_tags_service.rb

Constant Summary collapse

LOG_DATA_BASE =
{ service_class: self.to_s }.freeze

Constants inherited from BaseService

BaseService::UnauthorizedError

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#execute(container_repository) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/services/projects/container_repository/delete_tags_service.rb', line 8

def execute(container_repository)
  @container_repository = container_repository

  unless container_expiration_policy?
    return error('access denied') unless can?(current_user, :destroy_container_image_tag, project)
  end

  @tag_names = params[:tags]
  return error('no tags specified') if @tag_names.blank?

  delete_tags
end