Files
paperless-ngx/src/documents
stumpylog ceb82861bb Chore: Give restrict_queryset_to_visible one meaning for no user
Two near-identical helpers treated a missing user in opposite ways. restrict_queryset_to_visible returned everything for None while restrict_queryset_to_owner_visible and permitted_object_ids returned only unowned rows, and about a dozen call sites spelled the same restriction inline with permitted_object_ids. Which one a caller got decided whether a workflow could see another user's private objects, and it was easy to pick the wrong one.

restrict_queryset_to_visible now reads None as no identity, exactly like permitted_object_ids, and an active superuser still skips the subquery. restrict_queryset_to_owner_visible is gone and its AI callers use the single helper. The inline restrictions in the matching, tag, bulk edit, zone OCR and OCR template code use it too. The callers that really do want no restriction without a user, add_inbox_tags and the child tag list, now say so explicitly, so behavior is unchanged. exclude(pk__in=...) denial checks are left as they are, since they ask a different question.
2026-12-01 09:26:37 -08:00
..
2026-11-26 14:27:46 -08:00
2026-11-26 14:27:46 -08:00
2026-09-01 07:56:38 -07:00
2026-11-26 14:27:46 -08:00
2026-11-26 14:27:46 -08:00
2026-11-26 14:27:46 -08:00
2026-11-26 14:27:46 -08:00