diff options
Diffstat (limited to 'lib/sidebars/projects')
-rw-r--r-- | lib/sidebars/projects/menus/packages_registries_menu.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sidebars/projects/menus/packages_registries_menu.rb b/lib/sidebars/projects/menus/packages_registries_menu.rb index 27e318d73c5..d49bb680853 100644 --- a/lib/sidebars/projects/menus/packages_registries_menu.rb +++ b/lib/sidebars/projects/menus/packages_registries_menu.rb @@ -31,7 +31,7 @@ module Sidebars private def packages_registry_menu_item - if !::Gitlab.config.packages.enabled || !can?(context.current_user, :read_package, context.project) + if packages_registry_disabled? return ::Sidebars::NilMenuItem.new(item_id: :packages_registry) end @@ -58,7 +58,7 @@ module Sidebars end def infrastructure_registry_menu_item - if Feature.disabled?(:infrastructure_registry_page, context.current_user, default_enabled: :yaml) + if packages_registry_disabled? return ::Sidebars::NilMenuItem.new(item_id: :infrastructure_registry) end @@ -69,6 +69,10 @@ module Sidebars item_id: :infrastructure_registry ) end + + def packages_registry_disabled? + !::Gitlab.config.packages.enabled || !can?(context.current_user, :read_package, context.project) + end end end end |