import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { ExpensesComponent } from './expenses.component' ; import { ExpenseCategoriesComponent } from './expense-categories/expense-categories.component' ; import { NgxPermissionsGuard } from 'ngx-permissions' ; import { PermissionsEnum } from '@gauzy/contracts' ; export function redirectTo ( ) { return '/pages/dashboard' ; } const routes = [ { path : '' , component : ExpensesComponent , canActivate : [ NgxPermissionsGuard ] , data : { permissions : { only : [ PermissionsEnum . ORG_EXPENSES_VIEW ] , redirectTo } } } , { path : 'categories' , component : ExpenseCategoriesComponent , data : { selectors : { project : false , employee : false , date : false } } } ] ; @ NgModule ( { imports : [ RouterModule . forChild ( routes ) ] , exports : [ RouterModule ] } ) export class ExpensesRoutingModule { }