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