diff options
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 3cb04816d..9aa5549db 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -32,7 +32,8 @@ from django.urls import reverse from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy from django.apps import apps -from ishtar_common.data_importer import post_importer_action, pre_importer_action, ImporterError +from ishtar_common.data_importer import post_importer_action, pre_importer_action, \ + ImporterError from ishtar_common.model_managers import UUIDModelManager from ishtar_common.models import ValueGetter, get_current_profile, HistoryModel, Imported from ishtar_common.models_common import ( @@ -377,7 +378,10 @@ class Warehouse( icon_class="fa fa-pencil", text=_("Bulk update"), target="many", - rights=["change_warehouse", "change_own_warhouse"], + rights=[ + "archaeological_warehouse.change_warehouse", + "archaeological_warehouse.change_own_warhouse" + ], ) QA_LOCK = QuickAction( @@ -385,7 +389,10 @@ class Warehouse( icon_class="fa fa-lock", text=_("Lock/Unlock"), target="many", - rights=["change_warehouse", "change_own_warehouse"], + rights=[ + "archaeological_warehouse.change_warehouse", + "archaeological_warehouse.change_own_warehouse" + ], ) QUICK_ACTIONS = [ QA_LOCK, @@ -1105,21 +1112,30 @@ class Container( icon_class="fa fa-pencil", text=_("Bulk update"), target="many", - rights=["change_container", "change_own_container"], + rights=[ + "archaeological_warehouse.change_container", + "archaeological_warehouse.change_own_container" + ], ) QA_MOVE = QuickAction( url="container-qa-move", icon_class="fa fa-arrow-right", text=pgettext_lazy("action", "Move"), target="many", - rights=["change_container", "change_own_container"], + rights=[ + "archaeological_warehouse.change_container", + "archaeological_warehouse.change_own_container" + ], ) QA_LOCK = QuickAction( url="container-qa-lock", icon_class="fa fa-lock", text=_("Lock/Unlock"), target="many", - rights=["change_container", "change_own_container"], + rights=[ + "archaeological_warehouse.change_container", + "archaeological_warehouse.change_own_container" + ], ) QUICK_ACTIONS = [QA_EDIT, QA_MOVE, QA_LOCK] @@ -1939,7 +1955,7 @@ class Container( """ # url, base_text, icon, extra_text, extra css class, is a quick action actions = super(Container, self).get_extra_actions(request) - can_edit_find = self.can_do(request, "change_find") + can_edit_find = self.can_do(request, "archaeological_finds.change_find") if can_edit_find: actions += [ ( |