From 39de1924cb9dcfa93a5bdd95fa30c273f72fe420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Fri, 7 Mar 2014 18:57:03 +0100 Subject: [PATCH] Added extra permission check to speaker widget, fixed #1191 only for 1.5.x branch --- CHANGELOG | 2 ++ openslides/agenda/views.py | 2 +- openslides/projector/api.py | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 33acad76f..8f2f06e50 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,8 @@ Version 1.5.1 (unreleased) ========================== [https://github.com/OpenSlides/OpenSlides/issues?milestone=15] +Agenda: +- Fixed permission error in list of speakers widget. Participant: - Added permission to see participants also to the manager group. Files: diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 18637e688..ae2fb286c 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -669,6 +669,6 @@ def get_widgets(request): name='append_to_list_of_speakers', display_name=_('List of speakers'), template='agenda/speaker_widget.html', - permission_required='agenda.can_be_speaker', + permission_required=('agenda.can_be_speaker', 'agenda.can_manage_agenda'), # Short hack only for OpenSlides >=1.5.1, <1.6.0 default_column=1, default_weight=30)] diff --git a/openslides/projector/api.py b/openslides/projector/api.py index f1b52ddbc..5af433a2b 100644 --- a/openslides/projector/api.py +++ b/openslides/projector/api.py @@ -250,6 +250,11 @@ def get_all_widgets(request, session=False): session_widgets = request.session.get('widgets', {}) widgets = SortedDict() for widget in all_module_widgets: + if isinstance(widget.permission_required, tuple): + for perm in widget.permission_required: + if request.user.has_perm(perm): + widget.permission_required = None + break if (widget.permission_required is None or request.user.has_perm(widget.permission_required)): if not session or session_widgets.get(widget.get_name(), True):