fixed role naming instandhalter -> maintenance

This commit is contained in:
2025-10-21 20:23:12 +02:00
parent 2200ef6937
commit 5809e6c44c
13 changed files with 193 additions and 266 deletions

View File

@@ -19,7 +19,7 @@ import Setup from './pages/Setup/Setup';
// Protected Route Component
const ProtectedRoute: React.FC<{ children: React.ReactNode; roles?: string[] }> = ({
children,
roles = ['admin', 'instandhalter', 'user']
roles = ['admin', 'maintenance', 'user']
}) => {
const { user, loading, hasRole } = useAuth();
@@ -91,12 +91,12 @@ const AppContent: React.FC = () => {
</ProtectedRoute>
} />
<Route path="/shift-plans/new" element={
<ProtectedRoute roles={['admin', 'instandhalter']}>
<ProtectedRoute roles={['admin', 'maintenance']}>
<ShiftPlanCreate />
</ProtectedRoute>
} />
<Route path="/shift-plans/:id/edit" element={
<ProtectedRoute roles={['admin', 'instandhalter']}>
<ProtectedRoute roles={['admin', 'maintenance']}>
<ShiftPlanEdit />
</ProtectedRoute>
} />
@@ -106,7 +106,7 @@ const AppContent: React.FC = () => {
</ProtectedRoute>
} />
<Route path="/employees" element={
<ProtectedRoute roles={['admin', 'instandhalter']}>
<ProtectedRoute roles={['admin', 'maintenance']}>
<EmployeeManagement />
</ProtectedRoute>
} />