Skip to content

Commit

Permalink
prototype role guard
Browse files Browse the repository at this point in the history
  • Loading branch information
workcontrolgit committed Mar 14, 2023
1 parent 87c902f commit ea017e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const routes: Routes = [
Shell.childRoutes([
{
path: 'about',
canActivate: [AuthGuard],
// canActivate: [AuthGuard],
loadChildren: () => import('./about/about.module').then((m) => m.AboutModule),
},
]),
Expand All @@ -19,8 +19,8 @@ const routes: Routes = [
},
{
path: 'position',
canActivate: [AuthGuard],
loadChildren: () => import('./features/position/position.module').then((m) => m.PositionModule),
//data: {role: 'Manager'},
},

]),
Expand Down
5 changes: 3 additions & 2 deletions src/app/features/position/position-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import { PositionListComponent } from './list/position-list.component';
import { PositionDetailComponent } from './detail/position-detail.component';
import { marker } from '@biesbjerg/ngx-translate-extract-marker';
import { AuthGuard } from '@app/core/auth/auth-guard.service';
import { RoleGuard } from '@app/core/auth/role-guard.service';

const routes: Routes = [
{
path: '',
component: PositionListComponent,
canActivate: [AuthGuard],
canActivate: [RoleGuard],
data: { title: marker('Position') },
},
{
path: 'detail',
component: PositionDetailComponent,
canActivate: [AuthGuard],
// canActivate: [AuthGuard],
data: { title: marker('Position Detail') },
},
{
Expand Down

0 comments on commit ea017e9

Please sign in to comment.