diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-11-04 17:55:21 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-19 14:43:49 +0100 |
commit | ba26387f09de20d9537d075dcea5221fb3532a5a (patch) | |
tree | e8fadab722e806ee1511ac0f996afcc9fb44ce09 /archaeological_operations/views.py | |
parent | 547a20789faf6bbc9979357c7f65cbe61e56ed07 (diff) | |
download | Ishtar-ba26387f09de20d9537d075dcea5221fb3532a5a.tar.bz2 Ishtar-ba26387f09de20d9537d075dcea5221fb3532a5a.zip |
✨ permissions refactoring: manage deletion permissions - ♻ refactoring "can_do"
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r-- | archaeological_operations/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index eccf0e0b6..a93ba80e3 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -794,7 +794,8 @@ def site_add_operation(request, pks, current_right=None): if not q.count(): raise Http404() site = q.all()[0] - if not site.can_do(request, "view_archaeologicalsite") \ + if not site.can_do(request, "view", app="archaeological_operations", + model_name="archaeologicalsite") \ or site.operations.count(): raise Http404() # operation add permission checked on view call @@ -813,7 +814,8 @@ def site_add_top_operation(request, pks, current_right=None): if not q.count(): raise Http404() site = q.all()[0] - if not site.can_do(request, "view_archaeologicalsite") \ + if not site.can_do(request, "view", app="archaeological_operations", + model_name="archaeologicalsite") \ or not site.operations.count(): raise Http404() # operation add permission checked on view call |