2022-08-13 15:12:31 +05:30
|
|
|
# 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!
|
2022-10-11 01:57:18 +05:30
|
|
|
render_404 unless Feature.enabled?(:harbor_registry_integration, defined?(group) ? group : project)
|
2022-08-13 15:12:31 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def authorize_read_harbor_registry!
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|