aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-11-21 22:11:27 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2022-11-21 22:11:27 +0100
commitd0dbd52f34ee58212909a829343ea7d7bdc3916f (patch)
tree5d7a658ca496e71df87e3373b7a1cdc5f84a49ac
parentedit data export format to comply with midata (diff)
downloadscout-subs-d0dbd52f34ee58212909a829343ea7d7bdc3916f.tar.gz
scout-subs-d0dbd52f34ee58212909a829343ea7d7bdc3916f.zip
fix incorrect group check for permissions
Diffstat (limited to '')
-rw-r--r--server/views.py3
-rw-r--r--version.txt2
2 files changed, 3 insertions, 2 deletions
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
diff --git a/version.txt b/version.txt
index c37a3de..82de9ac 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.6
-rev=9
+rev=10