debian-mirror-gitlab/app/controllers/groups/dependency_proxies_controller.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
583 B
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# frozen_string_literal: true
module Groups
class DependencyProxiesController < Groups::ApplicationController
2021-10-27 15:23:28 +05:30
include ::DependencyProxy::GroupAccess
2021-01-29 00:20:46 +05:30
before_action :authorize_admin_dependency_proxy!, only: :update
2022-01-26 12:08:38 +05:30
before_action :verify_dependency_proxy_enabled!
2021-01-29 00:20:46 +05:30
feature_category :package_registry
private
def dependency_proxy
@dependency_proxy ||=
2022-01-26 12:08:38 +05:30
group.dependency_proxy_setting || group.create_dependency_proxy_setting!
2021-01-29 00:20:46 +05:30
end
2022-01-26 12:08:38 +05:30
def verify_dependency_proxy_enabled!
render_404 unless dependency_proxy.enabled?
2021-01-29 00:20:46 +05:30
end
end
end