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:
@ -1,6 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from rest_framework.decorators import detail_route
|
from rest_framework.decorators import detail_route
|
||||||
|
from rest_framework.exceptions import PermissionDenied
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet, ViewSet
|
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.
|
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.
|
# Retrieve and run the Report.
|
||||||
report = self._retrieve_report(pk)
|
report = self._retrieve_report(pk)
|
||||||
result = report.run()
|
result = report.run()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11.4 on 2017-09-22 15:21
|
# Generated by Django 1.11.4 on 2017-09-26 21:25
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -28,7 +28,6 @@ class Migration(migrations.Migration):
|
|||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ['report'],
|
'ordering': ['report'],
|
||||||
'permissions': (('run_report', 'Run a report and save the results'),),
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -405,9 +405,6 @@ class ReportResult(models.Model):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['report']
|
ordering = ['report']
|
||||||
permissions = (
|
|
||||||
('run_report', 'Run a report and save the results'),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user