Two entry points expose the same document export. Both accept a caller-supplied document ID; an authenticated user may export only a document whose owner equals that user. The worker can be invoked directly, so an API-only check is insufficient.
Flag the unsafe repository call in each original entry point and explain the shared authorization guarantee. Implement authorize_export(store, user, document_id) in policy.py and call it from both paths before exporting. Denial must raise PermissionError and produce no export side effect. Authorized calls return the existing export result. Missing documents are denied. Read store.py for the repository interface.