forked from nartc/ng-auth-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.routes.ts
executable file
·46 lines (45 loc) · 1.17 KB
/
app.routes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Routes } from '@angular/router';
import { AuthenticatedGuard, PermissionGuard } from '@volt/common/guards';
import { PermissionNames, Privilege } from '@volt/common/permissions';
import { AuthLayoutComponent, PublicLayoutComponent } from '@volt/layouts';
export const appRoutes: Routes = [
{
path: '',
redirectTo: 'dashboard',
pathMatch: 'full',
},
{
path: '',
canActivate: [AuthenticatedGuard],
component: AuthLayoutComponent,
children: [
{
path: 'dashboard',
canLoad: [PermissionGuard],
data: {
permission: [PermissionNames.DashboardManage, Privilege.Read],
},
loadChildren: () =>
import('@volt/features/dashboard').then((m) => m.DashboardModule),
},
],
},
{
path: '',
component: PublicLayoutComponent,
children: [
{
path: '',
loadChildren: () =>
import('@volt/features/security').then((m) => m.SecurityModule),
},
{
path: 'not-authorized',
loadChildren: () =>
import('@volt/features/not-authorized').then(
(m) => m.NotAuthorizedModule,
),
},
],
},
];