mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
Fix: correctly respect superuser for document history (#6661)
This commit is contained in:
parent
22c8d8ef2a
commit
5fec764018
2 changed files with 23 additions and 6 deletions
|
|
@ -767,7 +767,9 @@ class DocumentViewSet(
|
|||
try:
|
||||
doc = Document.objects.get(pk=pk)
|
||||
if not request.user.has_perm("auditlog.view_logentry") or (
|
||||
doc.owner is not None and doc.owner != request.user
|
||||
doc.owner is not None
|
||||
and doc.owner != request.user
|
||||
and not request.user.is_superuser
|
||||
):
|
||||
return HttpResponseForbidden(
|
||||
"Insufficient permissions",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue