如何使用ngx-permission在角度4中设置自定义权限而不是基于角色的权限。我正在尝试检查当前登录用户是否有权创建客户。
export const CustomerRouting: Routes = [
{
path: '',
component: CustomerComponent,
canActivate: [AuthGuard],
data: {
breadcrumb: 'Customers'
},
children: [
{
path: 'add',
component: CustomerAddComponent,
canActivate: [NgxPermissionsGuard],
data: {
breadcrumb: 'Add',
status: true,
permissions: {
only: 'addCustomer',
redirectTo: {
addCustomer: 'CustomerAddComponent',
default: 'login'
}
}
}
},

这会将我重定向到404.这个实现是否正确?