]>
Commit | Line | Data |
---|---|---|
1 | import { Routes } from '@angular/router' | |
2 | import { UserRightGuard } from '@app/core' | |
3 | import { UserRight } from '@shared/models' | |
4 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' | |
5 | import { UserListComponent } from './user-list' | |
6 | ||
7 | export const usersRoutes: Routes = [ | |
8 | { | |
9 | path: 'users', | |
10 | canActivate: [ UserRightGuard ], | |
11 | data: { | |
12 | userRight: UserRight.MANAGE_USERS | |
13 | }, | |
14 | children: [ | |
15 | { | |
16 | path: '', | |
17 | redirectTo: 'list', | |
18 | pathMatch: 'full' | |
19 | }, | |
20 | { | |
21 | path: 'list', | |
22 | component: UserListComponent, | |
23 | data: { | |
24 | meta: { | |
25 | title: $localize`Users list` | |
26 | } | |
27 | } | |
28 | }, | |
29 | { | |
30 | path: 'create', | |
31 | component: UserCreateComponent, | |
32 | data: { | |
33 | meta: { | |
34 | title: $localize`Create a user` | |
35 | } | |
36 | } | |
37 | }, | |
38 | { | |
39 | path: 'update/:id', | |
40 | component: UserUpdateComponent, | |
41 | data: { | |
42 | meta: { | |
43 | title: $localize`Update a user` | |
44 | } | |
45 | } | |
46 | } | |
47 | ] | |
48 | } | |
49 | ] |