debian-mirror-gitlab/app/controllers/projects/settings/packages_and_registries_controller.rb

29 lines
694 B
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# 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
def show
end
private
def packages_and_registries_settings_enabled!
2021-09-30 23:02:18 +05:30
render_404 unless can_destroy_container_registry_image?(project)
end
def can_destroy_container_registry_image?(project)
Gitlab.config.registry.enabled &&
can?(current_user, :destroy_container_image, project)
2021-06-08 01:23:25 +05:30
end
end
end
end