diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /lib/sidebars/projects/menus/packages_registries_menu.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'lib/sidebars/projects/menus/packages_registries_menu.rb')
-rw-r--r-- | lib/sidebars/projects/menus/packages_registries_menu.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sidebars/projects/menus/packages_registries_menu.rb b/lib/sidebars/projects/menus/packages_registries_menu.rb index 914368e6fec..2ddffe42899 100644 --- a/lib/sidebars/projects/menus/packages_registries_menu.rb +++ b/lib/sidebars/projects/menus/packages_registries_menu.rb @@ -15,7 +15,7 @@ module Sidebars override :title def title - _('Packages & Registries') + _('Packages and registries') end override :sprite_icon @@ -66,7 +66,9 @@ module Sidebars end def harbor_registry__menu_item - return ::Sidebars::NilMenuItem.new(item_id: :harbor_registry) if Feature.disabled?(:harbor_registry_integration) + if Feature.disabled?(:harbor_registry_integration, context.project) || context.project.harbor_integration.nil? + return ::Sidebars::NilMenuItem.new(item_id: :harbor_registry) + end ::Sidebars::MenuItem.new( title: _('Harbor Registry'), @@ -77,7 +79,8 @@ module Sidebars end def packages_registry_disabled? - !::Gitlab.config.packages.enabled || !can?(context.current_user, :read_package, context.project) + !::Gitlab.config.packages.enabled || + !can?(context.current_user, :read_package, context.project&.packages_policy_subject) end end end |