feat(rbac): integrate jenis simper CRUD permissions with super admin matrix

This commit is contained in:
Ray1111-aa
2026-10-27 11:16:14 +07:00
parent e8bb2259e8
commit 475dbbca1d
8 changed files with 115 additions and 15 deletions
@@ -34,14 +34,14 @@
<span>Kembali ke Data Personil</span>
</a>
@can('hse.employees.edit')
@if(auth()->user()->can('hse.simper_types.create') || auth()->user()->can('hse.employees.create') || auth()->user()->can('hse.employees.edit'))
<button type="button"
onclick="openAddSimperTypeModal()"
class="w-full sm:w-auto bg-[#1b5e20] hover:bg-[#144919] text-white px-4 py-2.5 rounded-xl text-xs font-bold flex items-center justify-center space-x-2 transition shadow-sm cursor-pointer">
<i class="fa-solid fa-plus text-xs"></i>
<span>Tambah Jenis SIMPER</span>
</button>
@endcan
@endif
</div>
</div>
@@ -178,14 +178,15 @@
</td>
<td class="py-4 px-5 text-center whitespace-nowrap">
<div class="flex items-center justify-center gap-1.5">
@can('hse.employees.edit')
@if(auth()->user()->can('hse.simper_types.edit') || auth()->user()->can('hse.employees.edit'))
<button type="button"
onclick="openEditSimperTypeModal({{ json_encode($st) }})"
class="inline-flex items-center justify-center w-8 h-8 rounded-lg text-amber-700 bg-amber-50 hover:bg-amber-100 transition border border-amber-200 cursor-pointer"
title="Edit Jenis SIMPER">
<i class="fa-regular fa-pen-to-square text-xs"></i>
</button>
@if($st->total_holders_count == 0)
@endif
@if((auth()->user()->can('hse.simper_types.delete') || auth()->user()->can('hse.employees.edit')) && $st->total_holders_count == 0)
<button type="button"
onclick="openDeleteSimperTypeModal({{ $st->id }}, '{{ $st->name }}')"
class="inline-flex items-center justify-center w-8 h-8 rounded-lg text-rose-700 bg-rose-50 hover:bg-rose-100 transition border border-rose-200 cursor-pointer"
@@ -193,7 +194,6 @@
<i class="fa-regular fa-trash-can text-xs"></i>
</button>
@endif
@endcan
</div>
</td>
</tr>
+12 -4
View File
@@ -253,25 +253,29 @@
@endif
<!-- Grup: Manajemen HSE -->
@can('hse.employees.view')
@if(auth()->user()->can('hse.employees.view') || auth()->user()->can('hse.simper_types.view'))
<div>
<p class="px-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider mb-2">
MANAJEMEN HSE
</p>
<nav class="space-y-1">
@can('hse.employees.view')
<a href="{{ route('hse.employees.index') }}"
class="flex items-center space-x-3 px-3.5 py-2.5 text-sm {{ request()->routeIs('hse.employees.*') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
<i class="fa-solid fa-id-card text-base w-5 text-center"></i>
<span>Data Simper</span>
</a>
@endcan
@if(auth()->user()->can('hse.simper_types.view') || auth()->user()->can('hse.employees.view'))
<a href="{{ route('hse.simper_types.index') }}"
class="flex items-center space-x-3 px-3.5 py-2.5 text-sm {{ request()->routeIs('hse.simper_types.*') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
<i class="fa-solid fa-sliders text-base w-5 text-center"></i>
<span>Jenis SIMPER</span>
</a>
@endif
</nav>
</div>
@endcan
@endif
<!-- Grup: Manajemen QMA -->
@if(auth()->user()->canAny(['qma.vehicles.view', 'qma.logs.view', 'qma.summary.view', 'qma.p2h.view', 'qma.p2h.templates']))
@@ -631,23 +635,27 @@
@endif
<!-- Grup: Manajemen HSE Mobile -->
@can('hse.employees.view')
@if(auth()->user()->can('hse.employees.view') || auth()->user()->can('hse.simper_types.view'))
<div>
<p class="px-2 text-[11px] font-bold text-slate-400 uppercase tracking-wider mb-2">
MANAJEMEN HSE
</p>
<nav class="space-y-1">
@can('hse.employees.view')
<a href="{{ route('hse.employees.index') }}" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-sm {{ request()->routeIs('hse.employees.*') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
<i class="fa-solid fa-id-card w-5 text-center"></i>
<span>Data Simper</span>
</a>
@endcan
@if(auth()->user()->can('hse.simper_types.view') || auth()->user()->can('hse.employees.view'))
<a href="{{ route('hse.simper_types.index') }}" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-sm {{ request()->routeIs('hse.simper_types.*') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
<i class="fa-solid fa-sliders w-5 text-center"></i>
<span>Jenis SIMPER</span>
</a>
@endif
</nav>
</div>
@endcan
@endif
<!-- Grup: Manajemen QMA Mobile -->
@if(auth()->user()->canAny(['qma.vehicles.view', 'qma.logs.view', 'qma.summary.view', 'qma.p2h.view', 'qma.p2h.templates']))