From 381e250712c13a82fb2d298de641d6a6c0841ced Mon Sep 17 00:00:00 2001 From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de> Date: Tue, 9 May 2017 15:03:04 +0200 Subject: [PATCH] List protocoltypes based on the user right in the /close #117 --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 2adc7ae..fe92ad4 100755 --- a/server.py +++ b/server.py @@ -212,8 +212,8 @@ def list_types(): user = current_user() types = [ protocoltype for protocoltype in ProtocolType.query.all() - if (protocoltype.public_group in user.groups - or protocoltype.private_group in user.groups + if (protocoltype.has_private_view_right(user) + or protocoltype.has_public_view_right(user) or protocoltype.is_public)] types = sorted(types, key=lambda t: t.short_name) types_table = ProtocolTypesTable(types) -- GitLab