Commit 6eab4b16 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'hide-group-container-registry-behind-feature-flag' into 'master'

Add FF for Registry group browser

See merge request gitlab-org/gitlab!18753
parents 09caff58 8b94d773
...@@ -4,6 +4,7 @@ module Groups ...@@ -4,6 +4,7 @@ module Groups
class RepositoriesController < Groups::ApplicationController class RepositoriesController < Groups::ApplicationController
before_action :verify_container_registry_enabled! before_action :verify_container_registry_enabled!
before_action :authorize_read_container_image! before_action :authorize_read_container_image!
before_action :feature_flag_group_container_registry_browser!
def index def index
track_event(:list_repositories) track_event(:list_repositories)
...@@ -22,6 +23,10 @@ module Groups ...@@ -22,6 +23,10 @@ module Groups
private private
def feature_flag_group_container_registry_browser!
render_404 unless Feature.enabled?(:group_container_registry_browser, group)
end
def verify_container_registry_enabled! def verify_container_registry_enabled!
render_404 unless Gitlab.config.registry.enabled render_404 unless Gitlab.config.registry.enabled
end end
......
...@@ -22,7 +22,9 @@ module GroupsHelper ...@@ -22,7 +22,9 @@ module GroupsHelper
end end
def group_container_registry_nav? def group_container_registry_nav?
Gitlab.config.registry.enabled && can?(current_user, :read_container_image, @group) Gitlab.config.registry.enabled &&
can?(current_user, :read_container_image, @group) &&
Feature.enabled?(:group_container_registry_browser, @group)
end end
def group_sidebar_links def group_sidebar_links
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment