Steuere das Herunterladen von Originalen je Rolle, benenne Dateien richtig und zeige HTML-Mails gesichert im Sandbox-Rahmen.
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 5m35s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 22s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-10-22 14:22:35 +02:00
1 parent 0a5daf6713
commit 075525ee17
26 files changed
+494 -71

No files matched your search

+4 -1
View File
@@ -101,7 +101,7 @@ from app.auth.security import (
verify_password,
verify_unknown_account,
)
from app.core.errors import Problem, forbidden, not_found, too_many, unprocessable
from app.core.errors import DOWNLOAD_REFUSED, Problem, forbidden, not_found, too_many, unprocessable
from app.core.timeutil import dump_date, dump_dt, utcnow
from app.media.port import read_clear_bytes
from app.media.storage import content_disposition
@@ -932,6 +932,7 @@ def download_file(
request: Request,
context_kind: str | None = None,
context_id: str | None = None,
save: bool = False,
principal: Principal = Depends(get_principal),
conn: Connection = Depends(get_conn),
):
@@ -942,6 +943,8 @@ def download_file(
rights = element_rights(conn, principal.account_id, element, context)
if not rights.read:
raise not_found()
if save and not rights.download:
raise forbidden(DOWNLOAD_REFUSED)
asset = conn.execute(
"""
SELECT id, original_filename, content_type, sha256, status,