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

Verify if registry is enabled in registry

parent 2f1cb7ce
class Projects::ContainerRegistryController < Projects::ApplicationController class Projects::ContainerRegistryController < Projects::ApplicationController
before_action :verify_registry_enabled
before_action :authorize_read_container_image! before_action :authorize_read_container_image!
before_action :authorize_update_container_image!, only: [:destroy] before_action :authorize_update_container_image!, only: [:destroy]
layout 'project' layout 'project'
...@@ -19,6 +20,10 @@ class Projects::ContainerRegistryController < Projects::ApplicationController ...@@ -19,6 +20,10 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
private private
def verify_registry_enabled
render_404 unless Gitlab.config.registry.enabled
end
def container_registry_repository def container_registry_repository
@container_registry_repository ||= project.container_registry_repository @container_registry_repository ||= project.container_registry_repository
end end
......
...@@ -152,7 +152,7 @@ module ProjectsHelper ...@@ -152,7 +152,7 @@ module ProjectsHelper
nav_tabs << :builds nav_tabs << :builds
end 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 nav_tabs << :container_registry
end 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