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

Removed custom permission

This commit is contained in:
Jeremy Stretch
2017-09-26 17:31:16 -04:00
parent 696d91daa3
commit f4c87b3739
3 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
from __future__ import unicode_literals
from rest_framework.decorators import detail_route
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet, ViewSet
@ -148,6 +149,10 @@ class ReportViewSet(ViewSet):
Run a Report and create a new ReportResult, overwriting any previous result for the Report.
"""
# Check that the user has permission to run reports.
if not request.user.has_perm('extras.add_reportresult'):
raise PermissionDenied("This user does not have permission to run reports.")
# Retrieve and run the Report.
report = self._retrieve_report(pk)
result = report.run()