fix: hak akses role - tambah label & cache untuk role other
- Role label: Other (Guest) di tabel permission - Cache di-clearing untuk role 'other' setelah update - Semua role dinamis dari controller
This commit is contained in:
@@ -69,7 +69,7 @@ class PermissionController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clear cache
|
// Clear cache
|
||||||
foreach (['admin', 'bk', 'wali_kelas', 'staff'] as $role) {
|
foreach (['admin', 'bk', 'wali_kelas', 'staff', 'other'] as $role) {
|
||||||
Cache::forget('role_permissions:' . $role);
|
Cache::forget('role_permissions:' . $role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,16 @@
|
|||||||
<tr class="bg-gray-50 border-b border-gray-200">
|
<tr class="bg-gray-50 border-b border-gray-200">
|
||||||
<th class="text-left px-4 py-3 font-semibold text-gray-700">Permission</th>
|
<th class="text-left px-4 py-3 font-semibold text-gray-700">Permission</th>
|
||||||
@foreach ($roles as $role)
|
@foreach ($roles as $role)
|
||||||
<th class="text-center px-3 py-3 font-semibold text-gray-700 capitalize">{{ $role }}</th>
|
@php
|
||||||
|
$label = [
|
||||||
|
'admin' => 'Admin',
|
||||||
|
'bk' => 'BK',
|
||||||
|
'wali_kelas' => 'Wali Kelas',
|
||||||
|
'staff' => 'Staff',
|
||||||
|
'other' => 'Other (Guest)',
|
||||||
|
][$role] ?? ucfirst($role);
|
||||||
|
@endphp
|
||||||
|
<th class="text-center px-3 py-3 font-semibold text-gray-700">{{ $label }}</th>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
Reference in New Issue
Block a user