From 7eaab16e308903e719d23909ee837be970016a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pocrnji=C4=8D?= Date: Thu, 15 Jan 2026 21:35:53 +0100 Subject: [PATCH] added new permission mass-archive instead if limiting mass archiving to admin users --- resources/js/Pages/Segments/Show.vue | 7 +++++-- routes/web.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/js/Pages/Segments/Show.vue b/resources/js/Pages/Segments/Show.vue index 54bd8e0..7a6b724 100644 --- a/resources/js/Pages/Segments/Show.vue +++ b/resources/js/Pages/Segments/Show.vue @@ -59,7 +59,7 @@ const exportDisabled = computed( const canManageSettings = computed(() => { const permissions = usePage().props?.auth?.user?.permissions || []; - return permissions.includes('manage-settings'); + return permissions.includes("mass-archive"); }); function toggleAllColumns(checked) { @@ -342,7 +342,10 @@ function submitArchive() { > Izvozi v Excel -
+
{{ selectedRows.length }} izbran{{ selectedRows.length === 1 ? "a" : "ih" diff --git a/routes/web.php b/routes/web.php index 0593d40..ec55b4d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -322,7 +322,7 @@ Route::get('client-cases/{client_case:uuid}', [ClientCaseContoller::class, 'show'])->name('clientCase.show'); Route::post('client-cases/{client_case:uuid}/contracts/{uuid}/segment', [ClientCaseContoller::class, 'updateContractSegment'])->name('clientCase.contract.updateSegment'); Route::post('client-cases/{client_case:uuid}/contracts/{uuid}/archive', [ClientCaseContoller::class, 'archiveContract'])->name('clientCase.contract.archive'); - Route::post('contracts/archive-batch', [ClientCaseContoller::class, 'archiveBatch'])->name('contracts.archive-batch')->middleware('permission:manage-settings'); + Route::post('contracts/archive-batch', [ClientCaseContoller::class, 'archiveBatch'])->name('contracts.archive-batch')->middleware('permission:mass-archive'); Route::post('client-cases', [ClientCaseContoller::class, 'store'])->name('clientCase.store'); Route::post('client-cases/{client_case:uuid}/emergency-person', [ClientCaseContoller::class, 'emergencyCreatePerson'])->name('clientCase.emergencyPerson'); // client-case / contract