On corrige quelques permissions

This commit is contained in:
Jean-Marie Favreau 2024-04-01 13:48:13 +02:00
parent 7b51236f06
commit 02d30d0fda

View File

@ -542,8 +542,7 @@ def imports(request):
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.add_batchimportation')
@permission_required('agenda_culturel.run_batchimportation')
@permission_required(['agenda_culturel.add_batchimportation', 'agenda_culturel.run_batchimportation'])
def add_import(request):
form = BatchImportationForm()
@ -561,8 +560,7 @@ def add_import(request):
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.view_batchimportation')
@permission_required('agenda_culturel.run_batchimportation')
@permission_required(['agenda_culturel.view_batchimportation', 'agenda_culturel.run_batchimportation'])
def cancel_import(request, pk):
import_process = get_object_or_404(BatchImportation, pk=pk)
@ -600,7 +598,7 @@ def recurrent_imports(request):
class RecurrentImportCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
model = RecurrentImport
permission_required = ("agenda_culturel.create_recurrentimport")
permission_required = ("agenda_culturel.add_recurrentimport")
success_url = reverse_lazy('recurrent_imports')
form_class = RecurrentImportForm
@ -620,8 +618,7 @@ class RecurrentImportDeleteView(SuccessMessageMixin, PermissionRequiredMixin, Lo
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.view_recurrentimport')
@permission_required('agenda_culturel.view_batchimportation')
@permission_required(['agenda_culturel.view_recurrentimport', 'agenda_culturel.view_batchimportation'])
def view_rimport(request, pk):
obj = get_object_or_404(RecurrentImport, pk=pk)
paginator = Paginator(BatchImportation.objects.filter(recurrentImport=pk).order_by("-created_date"), 10)
@ -639,8 +636,7 @@ def view_rimport(request, pk):
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.view_recurrentimport')
@permission_required('agenda_culturel.run_recurrentimport')
@permission_required(['agenda_culturel.view_recurrentimport', 'agenda_culturel.run_recurrentimport'])
def run_rimport(request, pk):
rimport = get_object_or_404(RecurrentImport, pk=pk)
@ -665,8 +661,7 @@ class DuplicatedEventsDetailView(LoginRequiredMixin, DetailView):
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.change_event')
@permission_required('agenda_culturel.change_duplicatedevents')
@permission_required(['agenda_culturel.change_event', 'agenda_culturel.change_duplicatedevents'])
def merge_duplicate(request, pk):
edup = get_object_or_404(DuplicatedEvents, pk=pk)
form = MergeDuplicates(duplicates=edup)
@ -717,8 +712,7 @@ def merge_duplicate(request, pk):
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.change_event')
@permission_required('agenda_culturel.change_duplicatedevents')
@permission_required(['agenda_culturel.change_event', 'agenda_culturel.change_duplicatedevents'])
def fix_duplicate(request, pk):
edup = get_object_or_404(DuplicatedEvents, pk=pk)
@ -865,8 +859,7 @@ class CategorisationRuleDeleteView(SuccessMessageMixin, PermissionRequiredMixin,
success_message = _('The categorisation rule has been successfully deleted.')
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.change_event')
@permission_required('agenda_culturel.apply_categorisationrule')
@permission_required('agenda_culturel.apply_categorisationrules')
def apply_categorisation_rules(request):
nb = 0