diff options
Diffstat (limited to 'lib/sidebars/groups/menus/settings_menu.rb')
-rw-r--r-- | lib/sidebars/groups/menus/settings_menu.rb | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/sidebars/groups/menus/settings_menu.rb b/lib/sidebars/groups/menus/settings_menu.rb index 18ff3ebc714..df170670aab 100644 --- a/lib/sidebars/groups/menus/settings_menu.rb +++ b/lib/sidebars/groups/menus/settings_menu.rb @@ -6,18 +6,23 @@ module Sidebars class SettingsMenu < ::Sidebars::Menu override :configure_menu_items def configure_menu_items - return false unless can?(context.current_user, :admin_group, context.group) - - add_item(general_menu_item) - add_item(integrations_menu_item) - add_item(access_tokens_menu_item) - add_item(group_projects_menu_item) - add_item(repository_menu_item) - add_item(ci_cd_menu_item) - add_item(applications_menu_item) - add_item(packages_and_registries_menu_item) - - true + if can?(context.current_user, :admin_group, context.group) + add_item(general_menu_item) + add_item(integrations_menu_item) + add_item(access_tokens_menu_item) + add_item(group_projects_menu_item) + add_item(repository_menu_item) + add_item(ci_cd_menu_item) + add_item(applications_menu_item) + add_item(packages_and_registries_menu_item) + return true + elsif Gitlab.ee? && can?(context.current_user, :change_push_rules, context.group) + # Push Rules are the only group setting that can also be edited by maintainers. + # Create an empty sub-menu here and EE adds Repository menu item (with only Push Rules). + return true + end + + false end override :title @@ -112,7 +117,7 @@ module Sidebars end ::Sidebars::MenuItem.new( - title: _('Packages & Registries'), + title: _('Packages and registries'), link: group_settings_packages_and_registries_path(context.group), active_routes: { controller: :packages_and_registries }, item_id: :packages_and_registries |