feat: restrict access to booking edit and invoice to applicant

This commit is contained in:
Björn Fromme
2025-09-10 15:30:36 +02:00
parent 297becf7a0
commit b197152f12
4 changed files with 58 additions and 54 deletions
+8 -6
View File
@@ -64,18 +64,20 @@
</td>
<td class="px-2 py-1 md:p-2">
<div class="flex md:flex-col space-x-2 md:space-x-0 md:space-y-1">
{% if booking.editable %}
{% if booking.editable and booking.applicantId == app.user.addressId %}
<a href="{{ path('app_booking_edit', { 'id': booking.id }) }}"
{{ stimulus_action('loading', 'toggle') }}
class="button bg-button bg-button--secondary button--small">
bearbeiten
</a>
{% endif %}
<a href="{{ path('app_booking_invoice', { 'id': booking.id }) }}"
class="button bg-button button--small"
target="_blank">
Rechnung
</a>
{% if booking.applicantId == app.user.addressId %}
<a href="{{ path('app_booking_invoice', { 'id': booking.id }) }}"
class="button bg-button button--small"
target="_blank">
Rechnung
</a>
{% endif %}
{% if booking.travelInfoUrl is not null %}
<a href="{{ booking.travelInfoUrl }}"
class="button bg-button bg-pink button--small"