Implement authentication feature with role-based access control and login dialog

This commit is contained in:
2025-11-07 17:53:11 +01:00
parent 87a1ab06d9
commit b4f0b7256a
11 changed files with 224 additions and 7 deletions

View File

@@ -7,10 +7,11 @@ import { MainComponent } from './main/main.component';
import { ScheduleComponent } from './schedule/schedule.component';
import { TheaterOverlayComponent} from './theater-overlay/theater-overlay.component';
import { MovieImporterComponent } from './movie-importer/movie-importer.component';
import { AuthGuard } from './auth.guard';
const routes: Routes = [
// Seiten ohne Layout
{ path: 'info', component: HomeComponent },
{ path: 'landing', component: HomeComponent },
{ path: 'poc-model', component: PocModelComponent },
// Seiten mit MainLayout
@@ -20,8 +21,13 @@ const routes: Routes = [
children: [
{ path: '', component: MainComponent },
{ path: 'schedule', component: ScheduleComponent },
{ path: 'admin/movie-importer', component: MovieImporterComponent },
{ path: 'selection/performance/:id', component: TheaterOverlayComponent}, //?
{
path: 'admin/movie-importer',
component: MovieImporterComponent,
canActivate: [AuthGuard],
data: { roles: ['admin'] }, // Array von erlaubten Rollen. Derzeit gäbe es 'admin' und 'employee'
},
{ path: 'selection/performance/:id', component: TheaterOverlayComponent},
],
},