diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-18 12:28:48 -0500 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-18 12:28:48 -0500 |
commit | 98a7486ba76eb7235174b4b6f74794c664df29da (patch) | |
tree | 48996587dc19403917c31c2d876f39b3ee3014ee | |
parent | 2f1cb7ce0439de003e92c55a27c6a8db7f0f1803 (diff) | |
download | gitlab-ce-98a7486ba76eb7235174b4b6f74794c664df29da.tar.gz |
Verify if registry is enabled in registry
-rw-r--r-- | app/controllers/projects/container_registry_controller.rb | 5 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/container_registry_controller.rb b/app/controllers/projects/container_registry_controller.rb index 3648f8894a6..d1f46497207 100644 --- a/app/controllers/projects/container_registry_controller.rb +++ b/app/controllers/projects/container_registry_controller.rb @@ -1,4 +1,5 @@ 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 @@ class Projects::ContainerRegistryController < Projects::ApplicationController 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 diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index b6ba66bf3e5..a140bbc3c67 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -152,7 +152,7 @@ module ProjectsHelper 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 |