diff --git a/sapl/compilacao/models.py b/sapl/compilacao/models.py index ff6cbdab1..812e48e27 100644 --- a/sapl/compilacao/models.py +++ b/sapl/compilacao/models.py @@ -266,10 +266,13 @@ class TextoArticulado(TimestampedMixin): user.has_perm( 'compilacao.change_your_dispositivo_edicao_dinamica')) - def has_view_permission(self, request): + def has_view_permission(self, request=None): if self.privacidade in (STATUS_TA_IMMUTABLE_PUBLIC, STATUS_TA_PUBLIC): return True + if not request: + return False + if request.user in self.owners.all(): return True diff --git a/sapl/templates/compilacao/text_list__embedded.html b/sapl/templates/compilacao/text_list__embedded.html index f5235751b..a448c9dd4 100644 --- a/sapl/templates/compilacao/text_list__embedded.html +++ b/sapl/templates/compilacao/text_list__embedded.html @@ -1,4 +1,3 @@ -{% extends "base.html" %} {% load i18n %} {% load compilacao_filters %} {% load common_tags %} @@ -9,20 +8,6 @@ {% endblock %} -{% block navigation %}{% endblock %} - -{% block main_header %}{% endblock %} -{% block title %}{% endblock %} -{% block sections_nav %}{% endblock %} -{% block extra_sections_nav %}{% endblock %} -{% block actions %}{% endblock %} -{% block dsp_actions %}{% endblock %} - -{% block detail_content %}{% endblock %} -{% block footer_container %}{% endblock %} - -{% block base_content %} -
{% if object_list %} @@ -93,13 +78,9 @@ {% include 'compilacao/text_list_bloco.html'%}
-{% endblock base_content %} - -{% block foot_js %} - - + + {% if perms.compilacao.add_nota %} - - {% endif %} -{% endblock %} + + {% endif %} \ No newline at end of file diff --git a/sapl/templates/norma/normajuridica_detail.html b/sapl/templates/norma/normajuridica_detail.html index 9ff25494e..0ead31671 100644 --- a/sapl/templates/norma/normajuridica_detail.html +++ b/sapl/templates/norma/normajuridica_detail.html @@ -77,7 +77,7 @@ - {% if object.texto_articulado.exists %} + {% if object.texto_articulado.exists and object.texto_articulado.first.has_view_permission %}
@@ -90,13 +90,13 @@ {% endblock detail_content %} {% block extra_js %} -{% if object.texto_articulado.exists %} +{% if object.texto_articulado.exists and object.texto_articulado.first.has_view_permission %}