Browse Source

Completa as permissoes de proposicoes

pull/579/head
Eduardo Calil 8 years ago
parent
commit
cb9029fd31
  1. 13
      sapl/materia/views.py

13
sapl/materia/views.py

@ -543,6 +543,19 @@ class ProposicaoCrud(Crud):
class ReciboProposicaoView(TemplateView): class ReciboProposicaoView(TemplateView):
template_name = "materia/recibo_proposicao.html" template_name = "materia/recibo_proposicao.html"
permission_required = permissoes_autor()
def has_permission(self):
perms = self.get_permission_required()
if self.request.user.has_perms(perms):
if (Proposicao.objects.filter(
id=self.kwargs['pk'],
autor__user_id=self.request.user.id).exists()):
return True
else:
return False
else:
return False
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(ReciboProposicaoView, self).get_context_data( context = super(ReciboProposicaoView, self).get_context_data(

Loading…
Cancel
Save