aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-06-01 14:29:10 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-06-01 14:29:10 +0100
commitf5cda7311f42b9ec9f4627121421b46b55e8346c (patch)
tree07615ffe6af0d1b995b9db436667fb1afc65fd92 /ctrack/organisations
parent4b1016247bc0b8f1c4d33b5a471b6f65a5b787b4 (diff)
added missing persmissions for views
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py
index d918c71..0dfe21d 100644
--- a/ctrack/organisations/views.py
+++ b/ctrack/organisations/views.py
@@ -16,10 +16,11 @@ class PersonListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
permission_required = "organisations.view_person"
-class OrganisationCreate(LoginRequiredMixin, CreateView):
+class OrganisationCreate(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
model = Organisation
template_name = "organisations/org_create_formset.html"
form_class = OrganisationCreateForm
+ permission_required = "organisations.add_organisation"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@@ -54,8 +55,9 @@ class OrganisationListView(LoginRequiredMixin, PermissionRequiredMixin, ListView
return context
-class OrganisationDetailView(LoginRequiredMixin, DetailView):
+class OrganisationDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
model = Organisation
+ permission_required = "organisations.view_organisation"
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
context = super().get_context_data()