diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
commit | b595cb0c1dec83de5bdee18284abe86614bed33b (patch) | |
tree | 8c3d4540f193c5ff98019352f554e921b3a41a72 /app/controllers/groups | |
parent | 2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff) |
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'app/controllers/groups')
5 files changed, 54 insertions, 13 deletions
diff --git a/app/controllers/groups/harbor/application_controller.rb b/app/controllers/groups/harbor/application_controller.rb new file mode 100644 index 00000000000..cff767c8efd --- /dev/null +++ b/app/controllers/groups/harbor/application_controller.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Groups + module Harbor + class ApplicationController < Groups::ApplicationController + layout 'group' + include ::Harbor::Access + + private + + def authorize_read_harbor_registry! + render_404 unless can?(current_user, :read_harbor_registry, @group) + end + end + end +end diff --git a/app/controllers/groups/harbor/artifacts_controller.rb b/app/controllers/groups/harbor/artifacts_controller.rb new file mode 100644 index 00000000000..b7570b44a2c --- /dev/null +++ b/app/controllers/groups/harbor/artifacts_controller.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Groups + module Harbor + class ArtifactsController < ::Groups::Harbor::ApplicationController + include ::Harbor::Artifact + + private + + def container + @group + end + end + end +end diff --git a/app/controllers/groups/harbor/repositories_controller.rb b/app/controllers/groups/harbor/repositories_controller.rb index 364607f9b20..1ad38bd7103 100644 --- a/app/controllers/groups/harbor/repositories_controller.rb +++ b/app/controllers/groups/harbor/repositories_controller.rb @@ -2,22 +2,13 @@ module Groups module Harbor - class RepositoriesController < Groups::ApplicationController - feature_category :integrations - - before_action :harbor_registry_enabled! - before_action do - push_frontend_feature_flag(:harbor_registry_integration) - end - - def show - render :index - end + class RepositoriesController < ::Groups::Harbor::ApplicationController + include ::Harbor::Repository private - def harbor_registry_enabled! - render_404 unless Feature.enabled?(:harbor_registry_integration) + def container + @group end end end diff --git a/app/controllers/groups/harbor/tags_controller.rb b/app/controllers/groups/harbor/tags_controller.rb new file mode 100644 index 00000000000..da43cb3f64c --- /dev/null +++ b/app/controllers/groups/harbor/tags_controller.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Groups + module Harbor + class TagsController < ::Groups::Harbor::ApplicationController + include ::Harbor::Tag + + private + + def container + @group + end + end + end +end diff --git a/app/controllers/groups/registry/repositories_controller.rb b/app/controllers/groups/registry/repositories_controller.rb index cb7bf001918..bb2d08e487a 100644 --- a/app/controllers/groups/registry/repositories_controller.rb +++ b/app/controllers/groups/registry/repositories_controller.rb @@ -8,6 +8,10 @@ module Groups before_action :verify_container_registry_enabled! before_action :authorize_read_container_image! + before_action do + push_frontend_feature_flag(:container_registry_show_shortened_path, group) + end + feature_category :container_registry urgency :low |