mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-20 04:26:53 +00:00
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:
1 parent
0c90c57e3e
commit
4788ac602b
10 files changed
+170
-27
No files matched your search
@@ -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"
|
||||
Reference in new issue
Block a user