Fix: limit manually run OCR templates to those the requester can view

A user editing someone else's document could run the owner's private
templates and see their names. Manual runs now use templates both can view.
This commit is contained in:
stumpylog committed 2026-11-18 07:55:52 -08:00
1 parent 0c90c57e3e
commit 4788ac602b
10 files changed
+170 -27

No files matched your search

+2 -1
View File
@@ -1262,9 +1262,10 @@ def run_zone_ocr(
doc_ids: list[int],
*,
template: int | None = None,
user: User | None = None,
) -> Literal["OK"]:
"""Run zone OCR within the tracked bulk operation task."""
for document_id in doc_ids:
extract_zones(document_id=document_id, template_id=template)
extract_zones(document_id=document_id, template_id=template, requester=user)
return "OK"