Skip to content
Snippets Groups Projects
Commit 98a7486b authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Verify if registry is enabled in registry

parent 2f1cb7ce
No related branches found
No related tags found
No related merge requests found
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'
Loading
@@ -19,6 +20,10 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
Loading
@@ -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
Loading
Loading
Loading
@@ -152,7 +152,7 @@ module ProjectsHelper
Loading
@@ -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
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment