Added few configurations & mores
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
import { getCurrentUser } from '@/lib/auth';
|
||||
import { hasPageAccess } from '@/lib/permissions';
|
||||
import DashboardLayout from '@/components/DashboardLayout';
|
||||
import ChauffeursTable from '@/components/ChauffeursTable';
|
||||
|
||||
@@ -10,6 +11,11 @@ export default async function ChauffeursPage() {
|
||||
redirect('/login');
|
||||
}
|
||||
|
||||
const hasAccess = await hasPageAccess(user.id, '/dashboard/chauffeurs');
|
||||
if (!hasAccess) {
|
||||
redirect('/dashboard/parametres');
|
||||
}
|
||||
|
||||
return (
|
||||
<DashboardLayout user={user}>
|
||||
<div className="p-6">
|
||||
|
||||
Reference in New Issue
Block a user