feat(admin): sync flexible unit kerja, employee type, and static backdrops with super admin user management

This commit is contained in:
Ray1111-aa
2026-10-27 21:38:04 +07:00
parent 4d24a98c41
commit 0642caebc1
5 changed files with 144 additions and 44 deletions
+4 -1
View File
@@ -25,10 +25,13 @@ class AppServiceProvider extends ServiceProvider
// Super Admin bypass: secara otomatis memiliki izin untuk semua ability
Gate::before(function ($user, $ability) {
if ($user->role === 'super_admin' || $user->role === 'admin') {
if (in_array($user->role, ['super_admin', 'superadmin', 'admin'])) {
return true;
}
try {
if (method_exists($user, 'isSuperAdmin') && $user->isSuperAdmin()) {
return true;
}
return $user->hasRole('super_admin') ? true : null;
} catch (\Throwable $e) {
return null;