gitlab-org--gitlab-foss/app/controllers/projects/container_registry_controller.rb

28 lines
770 B
Ruby
Raw Normal View History

2016-05-08 16:50:30 -04:00
class Projects::ContainerRegistryController < Projects::ApplicationController
2016-05-09 15:34:10 -04:00
before_action :authorize_read_container_registry!
before_action :authorize_update_container_registry!, only: [:destroy]
2016-05-08 16:50:30 -04:00
layout 'project'
def index
@tags = container_registry_repository.tags
2016-05-08 16:50:30 -04:00
end
def destroy
if tag.delete
redirect_to namespace_project_container_registry_index_path(project.namespace, project)
else
redirect_to namespace_project_container_registry_index_path(project.namespace, project), alert: 'Failed to remove tag'
end
end
private
def container_registry_repository
@container_registry_repository ||= project.container_registry_repository
2016-05-08 16:50:30 -04:00
end
def tag
2016-05-09 15:34:10 -04:00
@tag ||= container_registry_repository[params[:id]]
2016-05-08 16:50:30 -04:00
end
end