mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-09 01:27:12 +00:00
The trash list needs to show a version to whoever owns its root document, but it deliberately shows only owned and unowned documents and ignores explicit shares, so it cannot use permitted_object_ids. #14384 gave it its own filter_queryset with a hand-built condition through the root, which describes the same rule as the annotations in permitted_object_ids a second time. Move those annotations into annotate_authorizing_fields. PermittedObjectsFilter gains a parent_field attribute that its owner-only and granted paths both use, and the trash filter shrinks to setting include_granted and parent_field.