Steuere das Herunterladen von Originalen je Rolle, benenne Dateien richtig und zeige HTML-Mails gesichert im Sandbox-Rahmen.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a5daf6713
commit
075525ee17
26 files changed
+494
-71
No files matched your search
@@ -8,10 +8,10 @@ from uuid import UUID
|
||||
from fastapi import APIRouter, Depends, Request, Response
|
||||
from psycopg import Connection
|
||||
|
||||
from app.access.policy import Ctx, parse_query_context
|
||||
from app.access.policy import Ctx, get_matter, matter_rights, parse_query_context
|
||||
from app.api.deps import Principal, get_conn, get_principal
|
||||
from app.api.schemas import ExportIn
|
||||
from app.core.errors import unprocessable
|
||||
from app.core.errors import DOWNLOAD_REFUSED, forbidden, unprocessable
|
||||
from app.exporting import build_export, export_tree, review_export
|
||||
|
||||
router = APIRouter()
|
||||
@@ -79,6 +79,12 @@ def post_export(
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
selected, assignments = _selection(body)
|
||||
matter = get_matter(conn, matter_id)
|
||||
if matter is not None:
|
||||
rights = matter_rights(conn, principal.account_id, matter, _context(body.context))
|
||||
# Without any right the export itself answers as before. With read but no download right: refuse.
|
||||
if rights.read and not rights.download:
|
||||
raise forbidden(DOWNLOAD_REFUSED)
|
||||
filename, payload = build_export(
|
||||
conn,
|
||||
principal.account_id,
|
||||
|
||||
Reference in new issue
Block a user