diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/sidebars/projects/menus | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/sidebars/projects/menus')
-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 |