added new permission mass-archive instead if limiting mass archiving to admin users

This commit is contained in:
Simon Pocrnjič 2026-01-15 21:35:53 +01:00
parent 6a2dd860fa
commit 7eaab16e30
2 changed files with 6 additions and 3 deletions

View File

@ -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
</button>
<div v-if="canManageSettings && selectedRows.length" class="flex items-center gap-2">
<div
v-if="canManageSettings && selectedRows.length"
class="flex items-center gap-2"
>
<span class="text-sm text-gray-600"
>{{ selectedRows.length }} izbran{{
selectedRows.length === 1 ? "a" : "ih"

View File

@ -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