@@ -10,17 +10,21 @@ import { LoginComponent } from './login/login.component';
1010import { LinkThemesComponent } from './link-themes/link-themes.component' ;
1111import { UserManagementComponent } from './user-management/user-management.component' ;
1212import { AddUserComponent } from './add-user/add-user.component' ;
13- import { PatronsListComponent } from "./patrons-list/patrons-list.component" ;
13+ import { PatronsListComponent } from "./patrons-list/patrons-list.component" ;
14+ import { AdminGuardService as AdminGuard } from './service/admin-guard.service' ;
15+ import { AuthErrorComponent } from './auth-error/auth-error.component' ;
16+
1417
1518const routes : Routes = [
16- { path : "add-user" , component : AddUserComponent , canActivate : [ AuthGuard ] } ,
19+ { path : "add-user" , component : AddUserComponent , canActivate : [ AuthGuard , AdminGuard ] } ,
20+ { path : "auth-error" , component : AuthErrorComponent , canActivate : [ AuthGuard ] }
1721 { path : 'export/:id' , component : ExportComponent , canActivate : [ AuthGuard ] } ,
18- { path : 'user-management' , component : UserManagementComponent , canActivate : [ AuthGuard ] } ,
22+ { path : 'user-management' , component : UserManagementComponent , canActivate : [ AuthGuard , AdminGuard ] } ,
1923 { path : "add-theme" , component : ProposeThemeComponent } ,
2024 { path : 'list' , component : EpisodeListComponent , canActivate : [ AuthGuard ] } ,
21- { path : 'link-themes/:id' , component : LinkThemesComponent , canActivate : [ AuthGuard ] } ,
25+ { path : 'link-themes/:id' , component : LinkThemesComponent , canActivate : [ AuthGuard , AdminGuard ] } ,
2226 { path : 'episode-details/:id' , component : EpisodeDetailsComponent , canActivate : [ AuthGuard ] } ,
23- { path : 'patrons-list' , component : PatronsListComponent , canActivate : [ AuthGuard ] } ,
27+ { path : 'patrons-list' , component : PatronsListComponent , canActivate : [ AuthGuard , AdminGuard ] } ,
2428 { path : '**' , component : LoginComponent }
2529]
2630
0 commit comments