summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-11-07 17:31:57 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:43:49 +0100
commitce7d642318f4e4c57dd552915b12eef360d33d70 (patch)
tree64e499aec7087f8cca3159251c4bd107bedc416d /archaeological_operations/models.py
parent89ff92664ff06a974e37c15ab663394271ac4a10 (diff)
downloadIshtar-ce7d642318f4e4c57dd552915b12eef360d33d70.tar.bz2
Ishtar-ce7d642318f4e4c57dd552915b12eef360d33d70.zip
✨ permissions refactoring: settings for upstream items management
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index dd265fb1d..3f4f252c3 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -447,6 +447,10 @@ class ArchaeologicalSite(
"documents__associated_file__isnull",
"documents__associated_url__isnull",
]
+ UPPER_PERMISSIONS = [
+ (("archaeological_operations", "operation"),
+ "operations__pk"),
+ ]
ALT_NAMES = {
"reference": SearchAltName(
pgettext_lazy("key for text search", "reference"), "reference__iexact"
@@ -1321,6 +1325,10 @@ class Operation(
"cached_remains",
"cached_label",
]
+ UPPER_PERMISSIONS = [
+ (("archaeological_files", "file"),
+ "associated_file_id"),
+ ]
objects = UUIDModelManager()
# alternative names of fields for searches
@@ -2825,7 +2833,8 @@ post_save.connect(post_save_cache, sender=ActType)
post_delete.connect(post_save_cache, sender=ActType)
-class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter, SheetItem):
+class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter,
+ SheetItem):
SHOW_URL = "show-administrativeact"
TABLE_COLS = [
"full_ref",
@@ -3068,6 +3077,16 @@ class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter,
"operation__towns__numero_insee__startswith": "_get_department_code",
"associated_file__towns__numero_insee__startswith": "_get_department_code",
}
+ UPPER_PERMISSIONS = [
+ (("archaeological_operations", "operation"),
+ "operation_id"),
+ (("archaeological_files", "file"),
+ "associated_file_id"),
+ (("archaeological_finds", "treatmentfile"),
+ "treatment_file_id"),
+ (("archaeological_finds", "treatment"),
+ "treatment_id"),
+ ]
# fields
act_type = models.ForeignKey(