1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #5066: Update view_reportresult to view_report permission

This commit is contained in:
Jeremy Stretch
2020-09-23 13:40:15 -04:00
parent 90dbe9bf60
commit 0a40418614
5 changed files with 10 additions and 8 deletions

View File

@ -4,6 +4,8 @@
**NOTE:** This release removes support for the `DEFAULT_TIMEOUT` parameter under `REDIS` database configuration. Set `RQ_DEFAULT_TIMEOUT` as a global configuration parameter instead. **NOTE:** This release removes support for the `DEFAULT_TIMEOUT` parameter under `REDIS` database configuration. Set `RQ_DEFAULT_TIMEOUT` as a global configuration parameter instead.
**NOTE:** Any permissions referencing the legacy ReportResult model (e.g. `extras.view_reportresult`) should be updated to reference the Report model.
### Enhancements ### Enhancements
* [#1755](https://github.com/netbox-community/netbox/issues/1755) - Toggle order in which rack elevations are displayed * [#1755](https://github.com/netbox-community/netbox/issues/1755) - Toggle order in which rack elevations are displayed
@ -16,6 +18,7 @@
### Bug Fixes ### Bug Fixes
* [#5050](https://github.com/netbox-community/netbox/issues/5050) - Fix potential failure on `0016_replicate_interfaces` schema migration from old release * [#5050](https://github.com/netbox-community/netbox/issues/5050) - Fix potential failure on `0016_replicate_interfaces` schema migration from old release
* [#5066](https://github.com/netbox-community/netbox/issues/5066) - Update `view_reportresult` to `view_report` permission
* [#5075](https://github.com/netbox-community/netbox/issues/5075) - Include a VLAN membership view for VM interfaces * [#5075](https://github.com/netbox-community/netbox/issues/5075) - Include a VLAN membership view for VM interfaces
* [#5105](https://github.com/netbox-community/netbox/issues/5105) - Validation should fail when reassigning a primary IP from device to VM * [#5105](https://github.com/netbox-community/netbox/issues/5105) - Validation should fail when reassigning a primary IP from device to VM
* [#5109](https://github.com/netbox-community/netbox/issues/5109) - Fix representation of custom choice field values for webhook data * [#5109](https://github.com/netbox-community/netbox/issues/5109) - Fix representation of custom choice field values for webhook data
@ -24,7 +27,6 @@
* [#5118](https://github.com/netbox-community/netbox/issues/5118) - Specifying an empty list of tags should clear assigned tags (REST API) * [#5118](https://github.com/netbox-community/netbox/issues/5118) - Specifying an empty list of tags should clear assigned tags (REST API)
* [#5133](https://github.com/netbox-community/netbox/issues/5133) - Fix disassociation of an IP address from a VM interface * [#5133](https://github.com/netbox-community/netbox/issues/5133) - Fix disassociation of an IP address from a VM interface
* [#5136](https://github.com/netbox-community/netbox/issues/5136) - Fix exception when bulk editing interface 802.1Q mode * [#5136](https://github.com/netbox-community/netbox/issues/5136) - Fix exception when bulk editing interface 802.1Q mode
* [#5137](https://github.com/netbox-community/netbox/issues/5137) - Correct permission for viewing report results is `extras.view_reportresult` (not `extras.view_report`)
* [#5156](https://github.com/netbox-community/netbox/issues/5156) - Add missing "add" button to rack reservations list * [#5156](https://github.com/netbox-community/netbox/issues/5156) - Add missing "add" button to rack reservations list
* [#5167](https://github.com/netbox-community/netbox/issues/5167) - Support filtering ObjectChanges by multiple users * [#5167](https://github.com/netbox-community/netbox/issues/5167) - Support filtering ObjectChanges by multiple users

View File

@ -25,7 +25,7 @@ class Command(BaseCommand):
for report in report_list: for report in report_list:
if module_name in options['reports'] or report.full_name in options['reports']: if module_name in options['reports'] or report.full_name in options['reports']:
# Run the report and create a new ReportResult # Run the report and create a new JobResult
self.stdout.write( self.stdout.write(
"[{:%H:%M:%S}] Running {}...".format(timezone.now(), report.full_name) "[{:%H:%M:%S}] Running {}...".format(timezone.now(), report.full_name)
) )

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):
@ -401,7 +401,7 @@ class ReportResultView(ContentTypePermissionRequiredMixin, View):
Display a JobResult pertaining to the execution of a Report. Display a JobResult pertaining to the execution of a Report.
""" """
def get_required_permission(self): def get_required_permission(self):
return 'extras.view_reportresult' return 'extras.view_report'
def get(self, request, job_result_pk): def get(self, request, job_result_pk):
report_content_type = ContentType.objects.get(app_label='extras', model='report') report_content_type = ContentType.objects.get(app_label='extras', model='report')

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>