From d0dbd52f34ee58212909a829343ea7d7bdc3916f Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Mon, 21 Nov 2022 22:11:27 +0100 Subject: fix incorrect group check for permissions --- server/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/views.py b/server/views.py index 1fb80ac..fb4af8a 100644 --- a/server/views.py +++ b/server/views.py @@ -1651,10 +1651,11 @@ def docpreview(request): # get document document = Document.objects.filter(code=code)[0] + doc_group = document.group.name parent_group = document.user.groups.values_list('name', flat=True)[0] # user has not permission to view document - if parent_group not in groups: + if doc_group not in groups: return # prepare images in base64 -- cgit v1.2.1