Browse Source

Faz as permissoes de Casa Legislativa

pull/506/head
Eduardo Calil 9 years ago
parent
commit
428888634e
  1. 12
      sapl/base/views.py

12
sapl/base/views.py

@ -1,3 +1,4 @@
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.views.generic.base import TemplateView
from sapl.crud.base import Crud, CrudBaseMixin, CrudCreateView, CrudUpdateView
@ -14,17 +15,20 @@ class CasaLegislativaCrud(Crud):
model = CasaLegislativa
help_path = ''
class BaseMixin(CrudBaseMixin):
class BaseMixin(PermissionRequiredMixin, CrudBaseMixin):
permission_required = {'base.add_casalegislativa'}
list_field_names = ['codigo', 'nome', 'sigla']
class CreateView(CrudCreateView):
class CreateView(PermissionRequiredMixin, CrudCreateView):
permission_required = {'base.add_casa_legislativa'}
form_class = CasaLegislativaForm
class UpdateView(CrudUpdateView):
class UpdateView(PermissionRequiredMixin, CrudUpdateView):
permission_required = {'base.change_casalegislativa'}
form_class = CasaLegislativaForm
class HelpView(TemplateView):
class HelpView(PermissionRequiredMixin, TemplateView):
# XXX treat non existing template as a 404!!!!
def get_template_names(self):

Loading…
Cancel
Save