hitobito-kjv/app/controllers/kjv/csv_imports_controller.rb
KJV Bautzen e9675d5d0e Phase 1: Beitragsstatus und Mitgliedsausweis 🤖
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:19:06 +02:00

20 lines
812 B
Ruby

# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
# Wird Person::CsvImportsController vorangestellt: "Beitrag bezahlt bis" lässt sich nur
# importieren, wenn der Benutzer den Beitragsstatus in der Gruppe verwalten darf
# (Kassier*in). Für alle anderen wird eine solche Spaltenzuordnung verworfen.
module Kjv::CsvImportsController
private
def field_mappings
mappings = super
return mappings if can?(:manage_membership_fees, group)
mappings = mappings.to_unsafe_h if mappings.respond_to?(:to_unsafe_h)
mappings.reject { |_header, field| field.to_s == Kjv::MembershipFee::ATTR.to_s }
end
end