diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-27 20:58:50 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-27 20:58:50 +0100 |
commit | f0d3c954ea216351c4c6018dd17e132fc4a63ee2 (patch) | |
tree | 17e18b483e284dc74f95f64339391b94b5a95d21 /ctrack/organisations/views.py | |
parent | d2ae7679000b6299c408d34f88a1c5c66755288c (diff) |
permissions set for OrganisationListView
Diffstat (limited to '')
-rw-r--r-- | ctrack/organisations/views.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py index 1bccd3e..b929de4 100644 --- a/ctrack/organisations/views.py +++ b/ctrack/organisations/views.py @@ -41,11 +41,9 @@ class OrganisationCreate(LoginRequiredMixin, CreateView): return reverse_lazy("organisations:detail", kwargs={"slug": self.object.slug}) -class OrganisationListView(LoginRequiredMixin, UserPassesTestMixin, ListView): +class OrganisationListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): model = Organisation - - def test_func(self): - return self.request.user.is_staff + permission_required = "organisations.view_organisation" def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) |