Read about our upcoming Code of Conduct on this issue

Commit 98a7486b authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Verify if registry is enabled in registry

parent 86a9569d9d76
class Projects::ContainerRegistryController < Projects::ApplicationController
before_action :verify_registry_enabled
before_action :authorize_read_container_image!
before_action :authorize_update_container_image!, only: [:destroy]
layout 'project'
......@@ -19,6 +20,10 @@ def destroy
private
def verify_registry_enabled
render_404 unless Gitlab.config.registry.enabled
end
def container_registry_repository
@container_registry_repository ||= project.container_registry_repository
end
......
......@@ -152,7 +152,7 @@ def get_project_nav_tabs(project, current_user)
nav_tabs << :builds
end
if project.container_registry_repository_url.present? && can?(current_user, :read_container_image, project)
if Gitlab.config.registry.enabled && can?(current_user, :read_container_image, project)
nav_tabs << :container_registry
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment