2021-04-27 11:09:52 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects
|
|
|
|
module Settings
|
|
|
|
class PackagesAndRegistriesController < Projects::ApplicationController
|
|
|
|
layout 'project_settings'
|
|
|
|
|
|
|
|
before_action :authorize_admin_project!
|
|
|
|
before_action :packages_and_registries_settings_enabled!
|
|
|
|
|
|
|
|
feature_category :package_registry
|
2022-05-06 17:08:35 -04:00
|
|
|
urgency :low
|
2021-04-27 11:09:52 -04:00
|
|
|
|
2021-05-06 08:10:38 -04:00
|
|
|
def show
|
2021-04-27 11:09:52 -04:00
|
|
|
end
|
|
|
|
|
2022-08-16 02:10:05 -04:00
|
|
|
def cleanup_tags
|
|
|
|
registry_settings_enabled!
|
|
|
|
|
|
|
|
@hide_search_settings = true
|
|
|
|
end
|
|
|
|
|
2021-04-27 11:09:52 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def packages_and_registries_settings_enabled!
|
2022-06-17 02:08:15 -04:00
|
|
|
render_404 unless can?(current_user, :view_package_registry_project_settings, project)
|
2021-04-27 11:09:52 -04:00
|
|
|
end
|
2022-08-16 02:10:05 -04:00
|
|
|
|
|
|
|
def registry_settings_enabled!
|
|
|
|
render_404 unless Gitlab.config.registry.enabled &&
|
|
|
|
can?(current_user, :admin_container_image, project)
|
|
|
|
end
|
2021-04-27 11:09:52 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|