mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-08 20:03:18 +00:00
Cleans up the comment about why this is still here for now
This commit is contained in:
@@ -361,7 +361,7 @@ def get_objects_for_user_owner_aware(
|
||||
When include_deleted is True, soft-deleted items are also included.
|
||||
|
||||
Legacy slow path (guardian-backed, O(n) style permission resolution).
|
||||
The Stage 4 unification migrated most call sites onto
|
||||
Most queryset-filtering call sites have migrated onto
|
||||
``PermittedObjectsFilter``/``permitted_object_ids()``, but this function
|
||||
is kept because production callers still remain. Several callers remain
|
||||
across ``documents/``, ``paperless_mail/``, and ``paperless_ai/`` --
|
||||
@@ -388,11 +388,11 @@ def has_perms_owner_aware(user, perms, obj):
|
||||
"""
|
||||
Legacy slow path (guardian-backed) single-object permission check.
|
||||
|
||||
Stage 4's ``PermittedObjectsFilter``/``permitted_object_ids()`` covers
|
||||
queryset-level filtering, but this single-object check still has many
|
||||
production callers. Several callers remain across ``documents/``,
|
||||
``paperless_mail/``, and ``paperless_ai/`` -- grep for this function
|
||||
name before removing it.
|
||||
The queryset-filtering side of this migrated onto
|
||||
``PermittedObjectsFilter``/``permitted_object_ids()``, but this
|
||||
single-object check still has many production callers. Several callers
|
||||
remain across ``documents/``, ``paperless_mail/``, and ``paperless_ai/``
|
||||
-- grep for this function name before removing it.
|
||||
"""
|
||||
checker = ObjectPermissionChecker(user)
|
||||
return obj.owner is None or obj.owner == user or checker.has_perm(perms, obj)
|
||||
|
||||
Reference in New Issue
Block a user