mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-03-26 19:38:01 -04:00
Ah, thats why this is here
This commit is contained in:
parent
b9b22778fc
commit
ece061d41d
@ -145,6 +145,10 @@ def _permitted_document_ids(user):
|
||||
|
||||
base_docs = Document.objects.filter(deleted_at__isnull=True).only("id", "owner")
|
||||
|
||||
if user is None or not getattr(user, "is_authenticated", False):
|
||||
# Just Anonymous user e.g. for drf-spectacular
|
||||
return base_docs.filter(owner__isnull=True).values_list("id", flat=True)
|
||||
|
||||
if getattr(user, "is_superuser", False):
|
||||
return base_docs.values_list("id", flat=True)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user