feat: Face ID (scan, register, liveness) + role baru KS/Waka/Ketua Tim + notifikasi WA ortu + scoping wali kelas + error pages premium

This commit is contained in:
Novy San87
2026-08-02 20:57:11 +07:00
parent 0a5f471854
commit 6e256661dd
76 changed files with 5335 additions and 888 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class CheckRole
}
foreach ($roles as $role) {
if ($user->role === $role) {
if ($user->hasRole($role)) {
return $next($request);
}
}
+4 -10
View File
@@ -23,21 +23,15 @@ class PermissionMiddleware
}
// Admin always has all permissions
if ($user->role === 'admin') {
if ($user->isAdmin()) {
return $next($request);
}
// Cache role permissions (cleared when role_permissions changes)
$rolePermissions = Cache::remember('role_permissions:' . $user->role, 3600, function () use ($user) {
return \DB::table('role_permissions')
->join('permissions', 'role_permissions.permission_id', '=', 'permissions.id')
->where('role_permissions.role', $user->role)
->pluck('permissions.key')
->toArray();
});
// Gabungkan permission dari SEMUA role user (multi-role)
$userPermissions = $user->allPermissions();
foreach ($permissions as $permission) {
if (in_array($permission, $rolePermissions)) {
if (in_array($permission, $userPermissions)) {
return $next($request);
}
}