Hide Sort button in agenda (closes #3812)

This commit is contained in:
FinnStutzenstein 2018-08-27 11:23:58 +02:00
parent 768c97e89c
commit d1b52a9302
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 -->
<span os-perms="agenda.can_see_internal_items">
<a ui-sref="agenda.item.sort" os-perms="agenda.can_manage" class="btn btn-default btn-sm"> <a ui-sref="agenda.item.sort" os-perms="agenda.can_manage" class="btn btn-default btn-sm">
<i class="fa fa-sitemap fa-lg"></i> <i class="fa fa-sitemap fa-lg"></i>
<translate>Sort ...</translate> <translate>Sort ...</translate>
</a> </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: