Browse Source

Permitir divisão de permissões em tabelas auxiliáres

pull/1490/head
LeandroRoberto 7 years ago
parent
commit
38a852554f
  1. 1
      sapl/base/views.py
  2. 10
      sapl/crud/base.py
  3. 2
      sapl/utils.py

1
sapl/base/views.py

@ -24,6 +24,7 @@ from sapl.sessao.models import (PresencaOrdemDia, SessaoPlenaria,
SessaoPlenariaPresenca) SessaoPlenariaPresenca)
from sapl.utils import (parlamentares_ativos, sapl_logger, from sapl.utils import (parlamentares_ativos, sapl_logger,
show_results_filter_set) show_results_filter_set)
from .forms import (CasaLegislativaForm, ConfiguracoesAppForm, from .forms import (CasaLegislativaForm, ConfiguracoesAppForm,
RelatorioAtasFilterSet, RelatorioAtasFilterSet,
RelatorioHistoricoTramitacaoFilterSet, RelatorioHistoricoTramitacaoFilterSet,

10
sapl/crud/base.py

@ -938,16 +938,6 @@ class CrudAux(Crud):
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):
subnav_template_name = None subnav_template_name = None
def __init__(self, **kwargs):
super().__init__(**kwargs)
"""
Mantem as permissões individuais geradas pelo Crud através do
Modelo e adiciona a obrigatoriedade de permissão para view
tabelas auxiliares.
"""
self.permission_required = self.permission_required + \
self.crud.permission_required
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
"""Força o template filter subnav em base/templatetags/menus.py """Força o template filter subnav em base/templatetags/menus.py

2
sapl/utils.py

@ -647,7 +647,7 @@ def parlamentares_ativos(data_inicio, data_fim=None):
def show_results_filter_set(qr): def show_results_filter_set(qr):
query_params = set(qr.keys()) query_params = set(qr.keys())
if ((len(query_params) == 1 and 'iframe' in query_params) or if ((len(query_params) == 1 and 'iframe' in query_params) or
len(query_params) == 0): len(query_params) == 0):
return False return False
return True return True

Loading…
Cancel
Save