Fixes #5066: Permission for Report View

This commit is contained in:
rebortg 2020-09-02 22:31:29 +02:00
parent bbbfc27593
commit fc414d7962
3 changed files with 5 additions and 5 deletions

View File

@ -315,7 +315,7 @@ class ReportListView(ContentTypePermissionRequiredMixin, View):
Retrieve all of the available reports from disk and the recorded JobResult (if any) for each. Retrieve all of the available reports from disk and the recorded JobResult (if any) for each.
""" """
def get_required_permission(self): def get_required_permission(self):
return 'extras.view_reportresult' return 'extras.view_report'
def get(self, request): def get(self, request):
@ -347,7 +347,7 @@ class ReportView(ContentTypePermissionRequiredMixin, View):
Display a single Report and its associated JobResult (if any). Display a single Report and its associated JobResult (if any).
""" """
def get_required_permission(self): def get_required_permission(self):
return 'extras.view_reportresult' return 'extras.view_report'
def get(self, request, module, name): def get(self, request, module, name):

View File

@ -276,7 +276,7 @@
<div class="panel-heading"> <div class="panel-heading">
<strong>Reports</strong> <strong>Reports</strong>
</div> </div>
{% if report_results and perms.extras.view_reportresult %} {% if report_results and perms.extras.view_report %}
<table class="table table-hover panel-body"> <table class="table table-hover panel-body">
{% for result in report_results %} {% for result in report_results %}
<tr> <tr>
@ -285,7 +285,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
{% elif perms.extras.view_reportresult %} {% elif perms.extras.view_report %}
<div class="panel-body text-muted"> <div class="panel-body text-muted">
None found None found
</div> </div>

View File

@ -518,7 +518,7 @@
<li{% if not perms.extras.view_script %} class="disabled"{% endif %}> <li{% if not perms.extras.view_script %} class="disabled"{% endif %}>
<a href="{% url 'extras:script_list' %}">Scripts</a> <a href="{% url 'extras:script_list' %}">Scripts</a>
</li> </li>
<li{% if not perms.extras.view_reportresult %} class="disabled"{% endif %}> <li{% if not perms.extras.view_report %} class="disabled"{% endif %}>
<a href="{% url 'extras:report_list' %}">Reports</a> <a href="{% url 'extras:report_list' %}">Reports</a>
</li> </li>
</ul> </ul>