diff --git a/common/forms.py b/common/forms.py index 713830908..e651f16c7 100644 --- a/common/forms.py +++ b/common/forms.py @@ -250,10 +250,13 @@ class HMRCCDSManagerActions(TextChoices): class CommonUserActions(TextChoices): SEARCH = "SEARCH", "Search the tariff" - IMPORT = "IMPORT", "Import EU Taric files" # Change this to be dependent on permissions later +class ImportUserActions(TextChoices): + IMPORT = "IMPORT", "Import EU Taric files" + + class HomeForm(forms.Form): def __init__(self, *args, **kwargs): self.user = kwargs.pop("user") @@ -272,6 +275,11 @@ def __init__(self, *args, **kwargs): choices += CommonUserActions.choices + if self.user.has_perm("common.add_trackedmodel") or self.user.has_perm( + "common.change_trackedmodel" + ): + choices += ImportUserActions.choices + self.fields["workbasket_action"] = forms.ChoiceField( label="", choices=choices,