Welcome to mirror list, hosted at ThFree Co, Russian Federation.

access.rb « harbor « concerns « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 211566aeda7d3c5d4286f8c3f8ce3ccf706ee85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Harbor
  module Access
    extend ActiveSupport::Concern

    included do
      before_action :harbor_registry_enabled!
      before_action :authorize_read_harbor_registry!
      before_action do
        push_frontend_feature_flag(:harbor_registry_integration)
      end

      feature_category :integrations
    end

    private

    def harbor_registry_enabled!
      render_404 unless Feature.enabled?(:harbor_registry_integration, defined?(group) ? group : project)
    end

    def authorize_read_harbor_registry!
      raise NotImplementedError
    end
  end
end