presseportale/app/Models/ArchiveAccessLog.php
Kevin Adametz b5b70416f2 archive: Beweisarchiv — verschlüsselte Einträge, Legal Hold, Purge mit Tombstone, Restore-Abgleich, Auslöser und Admin-Seite (Bildkennzeichnung Block F)
- archive_entries (append-only) + archive_access_log; Disk archive außerhalb des Web-Roots; eigener ARCHIVE_KEY (archive:key), AES-256-CBC, SHA-256 am Eintrag
- EvidenceArchive: record/open/manifest/export (signiertes ZIP), setLegalHold/releaseLegalHold (Frist läuft neu), purgeDue, exportTombstones, reconcileAfterRestore
- PressReleaseArchiver: image_removed (Original, Snapshot, Bestätigungen), pm_depublished (letzter veröffentlichter Stand), gdpr_change (Anonymisierung, Korrekturen), label_corrected
- Hooks in Remover, depublish/archive/changeStatusFromAdmin/deleteFromAdmin, AnonymizationService, CorrectionService, ImageCorrectionService
- Scheduler archive:purge 03:20 und archive:export-tombstones 03:30; archive:reconcile-after-restore im Runbook
- Admin ▸ Management ▸ Beweisarchiv (Liste, Legal Hold mit Pflichtvermerk, Öffnen/Export nur mit Zweck)
- Scope-Wächter: neue Befehle nutzen withoutGlobalScope(PortalScope::class)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 10:04:21 +00:00

46 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Lesender Zugriff auf einen Archiveintrag (Beweisarchiv 4.3): wer, wann,
* wozu. Insert-only.
*/
class ArchiveAccessLog extends Model
{
public $timestamps = false;
protected $table = 'archive_access_log';
protected $fillable = ['entry_id', 'admin_id', 'action', 'purpose', 'accessed_at'];
protected function casts(): array
{
return ['accessed_at' => 'datetime'];
}
protected static function booted(): void
{
static::updating(fn () => throw new \LogicException('archive_access_log ist insert-only.'));
static::deleting(fn () => throw new \LogicException('archive_access_log wird nicht gelöscht.'));
}
/**
* @return BelongsTo<ArchiveEntry, $this>
*/
public function entry(): BelongsTo
{
return $this->belongsTo(ArchiveEntry::class, 'entry_id');
}
/**
* @return BelongsTo<User, $this>
*/
public function admin(): BelongsTo
{
return $this->belongsTo(User::class, 'admin_id');
}
}