diff --git a/CHANGELOG b/CHANGELOG index 19f2cf20b..e958831f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ Version 2.2 (unreleased) Agenda: - Fixed wrong sorting of last speakers [#3193]. - Fixed issue when sorting a new inserted speaker [#3210]. +- New permission for managing lists of speakers [#3366]. Motions: - New export dialog [#3185]. diff --git a/openslides/agenda/migrations/0003_auto_20170818_1202.py b/openslides/agenda/migrations/0003_auto_20170818_1202.py new file mode 100644 index 000000000..719058023 --- /dev/null +++ b/openslides/agenda/migrations/0003_auto_20170818_1202.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-08-18 10:02 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda', '0002_item_duration'), + ] + + operations = [ + migrations.AlterModelOptions( + name='item', + options={ + 'default_permissions': (), + 'permissions': ( + ('can_see', 'Can see agenda'), + ('can_manage', 'Can manage agenda'), + ('can_manage_list_of_speakers', 'Can manage list of speakers'), + ('can_see_hidden_items', 'Can see hidden items and time scheduling of agenda') + ) + }, + ), + ] diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 733e349f6..d8f9ed6c1 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -279,6 +279,7 @@ class Item(RESTModelMixin, models.Model): permissions = ( ('can_see', 'Can see agenda'), ('can_manage', 'Can manage agenda'), + ('can_manage_list_of_speakers', 'Can manage list of speakers'), ('can_see_hidden_items', 'Can see hidden items and time scheduling of agenda')) unique_together = ('content_type', 'object_id') diff --git a/openslides/agenda/static/js/agenda/site.js b/openslides/agenda/static/js/agenda/site.js index 73b04808e..1a2d7027a 100644 --- a/openslides/agenda/static/js/agenda/site.js +++ b/openslides/agenda/static/js/agenda/site.js @@ -451,7 +451,6 @@ angular.module('OpenSlidesApp.agenda.site', [ $http.post('/rest/agenda/item/' + $scope.item.id + '/manage_speaker/', {'user': userId}).then( function (success) { $scope.alert.show = false; - $scope.speakers = $scope.item.speakers; $scope.speakerSelectBox = {}; }, function (error) { $scope.alert = ErrorMessage.forAlert(error); @@ -468,11 +467,9 @@ angular.module('OpenSlidesApp.agenda.site', [ data: JSON.stringify({speaker: speakerId})} ) .then(function (success) { - $scope.speakers = $scope.item.speakers; }, function (error) { $scope.alert = ErrorMessage.forAlert(error); }); - $scope.speakers = $scope.item.speakers; }; //delete all speakers from list of speakers @@ -487,11 +484,9 @@ angular.module('OpenSlidesApp.agenda.site', [ data: JSON.stringify({speaker: speakersOnList})} ) .then(function (success) { - $scope.speakers = $scope.item.speakers; }, function (error) { $scope.alert = ErrorMessage.forAlert(error); }); - $scope.speakers = $scope.item.speakers; }; // Return true if the requested user is allowed to do a specific action @@ -512,13 +507,13 @@ angular.module('OpenSlidesApp.agenda.site', [ } return false; case 'removeAll': - return (operator.hasPerms('agenda.can_manage') && + return (operator.hasPerms('agenda.can_manage_list_of_speakers') && $scope.speakers.length > 0); case 'beginNextSpeech': - return (operator.hasPerms('agenda.can_manage') && + return (operator.hasPerms('agenda.can_manage_list_of_speakers') && $scope.nextSpeakers.length > 0); case 'endCurrentSpeech': - return (operator.hasPerms('agenda.can_manage') && + return (operator.hasPerms('agenda.can_manage_list_of_speakers') && $scope.currentSpeaker.length > 0); case 'showLastSpeakers': return $scope.lastSpeakers.length > 0; diff --git a/openslides/agenda/static/templates/agenda/list-of-speakers-partial-management.html b/openslides/agenda/static/templates/agenda/list-of-speakers-partial-management.html index 63f1859fc..e0e21788f 100644 --- a/openslides/agenda/static/templates/agenda/list-of-speakers-partial-management.html +++ b/openslides/agenda/static/templates/agenda/list-of-speakers-partial-management.html @@ -1,13 +1,15 @@