diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 805609b9b..c7462ca77 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -2045,9 +2045,11 @@ def retira_materias_ja_adicionadas(id_sessao, model): return lista_id_materias -class AdicionarVariasMateriasExpediente(MateriaLegislativaPesquisaView): +class AdicionarVariasMateriasExpediente(PermissionRequiredMixin, + MateriaLegislativaPesquisaView): filterset_class = AdicionarVariasMateriasFilterSet template_name = 'sessao/adicionar_varias_materias_expediente.html' + permission_required = permissoes_sessao() def get_filterset_kwargs(self, filterset_class): super(AdicionarVariasMateriasExpediente, @@ -2123,6 +2125,7 @@ class AdicionarVariasMateriasExpediente(MateriaLegislativaPesquisaView): class AdicionarVariasMateriasOrdemDia(AdicionarVariasMateriasExpediente): filterset_class = AdicionarVariasMateriasFilterSet template_name = 'sessao/adicionar_varias_materias_ordem.html' + permission_required = permissoes_sessao() def get_filterset_kwargs(self, filterset_class): super(AdicionarVariasMateriasExpediente, diff --git a/sapl/templates/sessao/expedientemateria_list.html b/sapl/templates/sessao/expedientemateria_list.html index 01cf53b61..28b8482ea 100644 --- a/sapl/templates/sessao/expedientemateria_list.html +++ b/sapl/templates/sessao/expedientemateria_list.html @@ -1,12 +1,17 @@ {% extends "crud/list.html" %} {% load i18n %} +{% load common_tags %} {% block more_buttons %} - - {% blocktrans with verbose_name=view.verbose_name %} Reordenar Matérias {% endblocktrans %} - - - {% blocktrans with verbose_name=view.verbose_name %} Adicionar Várias Matérias {% endblocktrans %} - + +{% if perms|get_add_perm:view %} + + {% blocktrans with verbose_name=view.verbose_name %} Reordenar Matérias {% endblocktrans %} + + + {% blocktrans with verbose_name=view.verbose_name %} Adicionar Várias Matérias {% endblocktrans %} + +{% endif %} + {% endblock more_buttons %} diff --git a/sapl/templates/sessao/ordemdia_list.html b/sapl/templates/sessao/ordemdia_list.html index 9b052aac1..a6b885558 100644 --- a/sapl/templates/sessao/ordemdia_list.html +++ b/sapl/templates/sessao/ordemdia_list.html @@ -1,12 +1,17 @@ {% extends "crud/list.html" %} {% load i18n %} +{% load common_tags %} {% block more_buttons %} - - {% blocktrans with verbose_name=view.verbose_name %} Reordenar Matérias {% endblocktrans %} - - - {% blocktrans with verbose_name=view.verbose_name %} Adicionar Várias Matérias {% endblocktrans %} - + +{% if perms|get_add_perm:view %} + + {% blocktrans with verbose_name=view.verbose_name %} Reordenar Matérias {% endblocktrans %} + + + {% blocktrans with verbose_name=view.verbose_name %} Adicionar Várias Matérias {% endblocktrans %} + +{% endif %} + {% endblock more_buttons %}