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

+3 -2
View File
@@ -55,10 +55,11 @@ USER_OPERATIONS = frozenset(
"edit_pdf",
"remove_password",
"merge_as_versions",
"run_zone_ocr",
},
)
# merge_as_versions doesn't queue any consume tasks
TRIGGER_SOURCE_OPERATIONS = USER_OPERATIONS - {"merge_as_versions"}
# These don't queue any consume tasks
TRIGGER_SOURCE_OPERATIONS = USER_OPERATIONS - {"merge_as_versions", "run_zone_ocr"}
def snapshot_field(doc_ids: list[int], field: str) -> dict[int, Any]: