Merge pull request #3832 from FinnStutzenstein/hideSortInAgenda

Hide Sort button in agenda (closes #3812)
This commit is contained in:
Emanuel Schütze 2018-08-27 12:14:26 +02:00 committed by GitHub
commit 1dd1a4bac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -73,10 +73,12 @@
<translate>Select ...</translate> <translate>Select ...</translate>
</button> </button>
<!-- sort button --> <!-- sort button -->
<a ui-sref="agenda.item.sort" os-perms="agenda.can_manage" class="btn btn-default btn-sm"> <span os-perms="agenda.can_see_internal_items">
<i class="fa fa-sitemap fa-lg"></i> <a ui-sref="agenda.item.sort" os-perms="agenda.can_manage" class="btn btn-default btn-sm">
<translate>Sort ...</translate> <i class="fa fa-sitemap fa-lg"></i>
</a> <translate>Sort ...</translate>
</a>
</span>
<!-- auto numbering button --> <!-- auto numbering button -->
<span ng-if="config('agenda_enable_numbering')"> <span ng-if="config('agenda_enable_numbering')">
<button os-perms="agenda.can_manage" class="btn btn-default btn-sm" <button os-perms="agenda.can_manage" class="btn btn-default btn-sm"

View File

@ -44,14 +44,14 @@ class ItemViewSet(ListModelMixin, RetrieveModelMixin, UpdateModelMixin, GenericV
result = has_perm(self.request.user, 'agenda.can_see') result = has_perm(self.request.user, 'agenda.can_see')
# For manage_speaker and tree requests the rest of the check is # For manage_speaker and tree requests the rest of the check is
# done in the specific method. See below. # done in the specific method. See below.
elif self.action in ('partial_update', 'update'): elif self.action in ('partial_update', 'update', 'sort'):
result = (has_perm(self.request.user, 'agenda.can_see') and result = (has_perm(self.request.user, 'agenda.can_see') and
has_perm(self.request.user, 'agenda.can_see_internal_items') and has_perm(self.request.user, 'agenda.can_see_internal_items') and
has_perm(self.request.user, 'agenda.can_manage')) has_perm(self.request.user, 'agenda.can_manage'))
elif self.action in ('speak', 'sort_speakers'): elif self.action in ('speak', 'sort_speakers'):
result = (has_perm(self.request.user, 'agenda.can_see') and result = (has_perm(self.request.user, 'agenda.can_see') and
has_perm(self.request.user, 'agenda.can_manage_list_of_speakers')) has_perm(self.request.user, 'agenda.can_manage_list_of_speakers'))
elif self.action in ('numbering', 'sort'): elif self.action in ('numbering'):
result = (has_perm(self.request.user, 'agenda.can_see') and result = (has_perm(self.request.user, 'agenda.can_see') and
has_perm(self.request.user, 'agenda.can_manage')) has_perm(self.request.user, 'agenda.can_manage'))
else: else: