Checkpoint: Ajout du rôle super_formateur avec accès à toutes les formations et séquences. Migration SQL appliquée en local et sur le VPS de production.
This commit is contained in:
@@ -148,6 +148,10 @@ export default function DashboardLayout({
|
||||
if (user && user.role === 'formateur' && location === '/admin') {
|
||||
setLocation('/formateur');
|
||||
}
|
||||
// Les super formateurs vont sur /admin comme les admins
|
||||
if (user && user.role === 'super_formateur' && location === '/formateur') {
|
||||
setLocation('/admin');
|
||||
}
|
||||
}, [user, location, setLocation]);
|
||||
|
||||
if (loading) {
|
||||
@@ -224,6 +228,10 @@ function DashboardLayoutContent({
|
||||
if (user?.role === 'formateur') {
|
||||
return section.title !== 'Configuration' && section.title !== 'Traçabilité' && section.title !== 'Analyses' && section.title !== 'Gestion technique';
|
||||
}
|
||||
// Les super formateurs ne voient pas Gestion technique
|
||||
if (user?.role === 'super_formateur') {
|
||||
return section.title !== 'Gestion technique';
|
||||
}
|
||||
return true;
|
||||
}).map(section => {
|
||||
// Modifier le chemin du tableau de bord pour les formateurs
|
||||
|
||||
Reference in New Issue
Block a user