summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-10-16 17:57:13 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:43:48 +0100
commitc93dd3812c53d21ab8517dc7af72e1d4b70a1b04 (patch)
tree2153d8fd121f7ecd08a31e4867d58a2eb3c9aab7 /archaeological_files/models.py
parentb8eef9b6aaed7ee097f8ea86174067f9ca42abd8 (diff)
downloadIshtar-c93dd3812c53d21ab8517dc7af72e1d4b70a1b04.tar.bz2
Ishtar-c93dd3812c53d21ab8517dc7af72e1d4b70a1b04.zip
♻ permissions refactoring: refactor has_permission methods
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r--archaeological_files/models.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 222c7b700..1f164c30d 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -27,12 +27,13 @@ from django.contrib.gis.db import models
from django.contrib.postgres.indexes import GinIndex
from django.core.cache import cache
from django.core.validators import MinValueValidator, MaxValueValidator
-from django.db.models import Q, Count, Sum, Max
+from django.db.models import Max
from django.db.models.signals import post_save, m2m_changed, post_delete
from django.urls import reverse
from ishtar_common.models_common import OrderedHierarchicalType
-from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy, get_current_profile, InlineClass
+from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy, get_current_profile, \
+ InlineClass
from ishtar_common.utils import (
cached_label_changed,
@@ -1548,7 +1549,7 @@ class File(
def get_extra_actions(self, request):
# url, base_text, icon, extra_text, extra css class, is a quick action
actions = super(File, self).get_extra_actions(request)
- if self.can_do(request, "change_operation"):
+ if self.can_do(request, "archaeological_files.change_file"):
actions += [
(
reverse("file-parcels-modify", args=[self.pk]),
@@ -1571,7 +1572,7 @@ class File(
False,
),
]
- if self.can_do(request, "add_administrativeact"):
+ if self.can_do(request, "archaeological_operations.add_administrativeact"):
actions += [
(
reverse("file-add-adminact", args=[self.pk]),
@@ -1582,7 +1583,7 @@ class File(
False,
),
]
- if self.can_do(request, "add_operation"):
+ if self.can_do(request, "archaeological_operations.add_operation"):
actions += [
(
reverse("file-add-operation", args=[self.pk]),