From 547a20789faf6bbc9979357c7f65cbe61e56ed07 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 29 Oct 2024 17:50:49 +0100 Subject: ✨ permissions refactoring: link items to user QA forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_files/models.py | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'archaeological_files/models.py') diff --git a/archaeological_files/models.py b/archaeological_files/models.py index b3815c95d..04481889f 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -45,26 +45,27 @@ from ishtar_common.utils import ( ) from ishtar_common.models import ( + BaseHistorizedItem, + CompleteIdentifierItem, + DashboardFormItem, Department, + Document, + DocumentItem, GeneralType, GlobalVar, - BaseHistorizedItem, - Imported, - OwnPerms, - Person, - Organization, - Town, - DashboardFormItem, HistoricalRecords, - ValueGetter, + HistoryModel, + Imported, MainItem, OperationType, + Organization, + OwnPerms, + Person, post_save_cache, - Document, - HistoryModel, + QuickAction, SearchVectorConfig, - DocumentItem, - CompleteIdentifierItem, + Town, + ValueGetter, ) from archaeological_operations.models import ( @@ -619,6 +620,16 @@ class File( HISTORICAL_M2M = ["towns", "departments"] SERIALIZE_PROPERTIES = ["external_id"] + QA_LINK = QuickAction( + url="file-qa-link", + icon_class="fa fa-link", + text=_("Link to account"), + target="many", + rights=["ishtaradmin"], + ) + QUICK_ACTIONS = [ + QA_LINK + ] # fields year = models.IntegerField(_("Year"), default=get_current_year) -- cgit v1.2.3