Added few configurations & mores

This commit is contained in:
2026-01-22 18:53:23 +01:00
parent 9051491fd0
commit d5d0d5aaf4
30 changed files with 3309 additions and 80 deletions

View File

@@ -0,0 +1,21 @@
import { NextRequest, NextResponse } from 'next/server';
import { getCurrentUser } from '@/lib/auth';
import { getUserAccessiblePages } from '@/lib/permissions';
export async function GET(request: NextRequest) {
try {
const user = await getCurrentUser();
if (!user) {
return NextResponse.json({ error: 'Non autorisé' }, { status: 401 });
}
const accessiblePages = await getUserAccessiblePages(user.id);
return NextResponse.json({ pages: accessiblePages });
} catch (error) {
console.error('Erreur lors de la récupération des pages accessibles:', error);
return NextResponse.json(
{ error: 'Erreur serveur' },
{ status: 500 }
);
}
}