Berarbeiter dürfen Stundenbuchung löschen

This commit is contained in:
Erik Thiele
2026-05-22 23:43:54 +02:00
parent 0a86f49310
commit 54ae12771e
6 changed files with 930 additions and 231 deletions

View File

@@ -629,7 +629,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$notice = 'Stunden gebucht.';
}
if ($user && $action === 'delete_booking' && ($user['role'] ?? '') === 'admin' && $pdo) {
if ($user && $action === 'delete_booking' && hasRole($user, ['editor', 'admin']) && $pdo) {
$bookingId = (int)($_POST['booking_id'] ?? 0);
$stmt = $pdo->prepare('DELETE FROM work_logs WHERE id = ?');
$stmt->execute([$bookingId]);