Skip to content
Snippets Groups Projects
Commit 8730fc38 authored by James Graham's avatar James Graham
Browse files

Define required permissions on update and delete views

parent a97eefed
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,7 @@ class ApplicationUpdateView(OwnerPermissionMixin, UpdateView): ...@@ -46,6 +46,7 @@ class ApplicationUpdateView(OwnerPermissionMixin, UpdateView):
context_object_name = 'application' context_object_name = 'application'
fields = '__all__' fields = '__all__'
permission_required = 'applications.change_application'
class ApplicationDeleteView(OwnerPermissionMixin, DeleteView): class ApplicationDeleteView(OwnerPermissionMixin, DeleteView):
...@@ -53,6 +54,7 @@ class ApplicationDeleteView(OwnerPermissionMixin, DeleteView): ...@@ -53,6 +54,7 @@ class ApplicationDeleteView(OwnerPermissionMixin, DeleteView):
template_name = 'applications/application/delete.html' template_name = 'applications/application/delete.html'
context_object_name = 'application' context_object_name = 'application'
permission_required = 'application.delete_application'
success_url = reverse_lazy('applications:application.list') success_url = reverse_lazy('applications:application.list')
......
...@@ -77,6 +77,7 @@ class DataSourceUpdateView(OwnerPermissionMixin, UpdateView): ...@@ -77,6 +77,7 @@ class DataSourceUpdateView(OwnerPermissionMixin, UpdateView):
context_object_name = 'datasource' context_object_name = 'datasource'
form_class = forms.DataSourceForm form_class = forms.DataSourceForm
permission_required = 'datasources.change_datasource'
class DataSourceDeleteView(OwnerPermissionMixin, DeleteView): class DataSourceDeleteView(OwnerPermissionMixin, DeleteView):
...@@ -84,6 +85,7 @@ class DataSourceDeleteView(OwnerPermissionMixin, DeleteView): ...@@ -84,6 +85,7 @@ class DataSourceDeleteView(OwnerPermissionMixin, DeleteView):
template_name = 'datasources/datasource/delete.html' template_name = 'datasources/datasource/delete.html'
context_object_name = 'datasource' context_object_name = 'datasource'
permission_required = 'datasources.delete_datasource'
success_url = reverse_lazy('datasources:datasource.list') success_url = reverse_lazy('datasources:datasource.list')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment