Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple redirection rules. Redirect if has permission #159

Open
roma2341 opened this issue Mar 3, 2021 · 1 comment
Open

Multiple redirection rules. Redirect if has permission #159

roma2341 opened this issue Mar 3, 2021 · 1 comment

Comments

@roma2341
Copy link

roma2341 commented Mar 3, 2021

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x ] Feature request
[ ] Documentation issue or request

Current behavior

Redirection rule can only fire when user has no permission

Expected behavior

There should be the way to make this works like intended - redirect admin's to admin route and etc.

{
    path: '',
    component: ɵEmptyOutletComponent,
    canActivate: [NgxPermissionsGuard],
    data: {
      permissions: {
        only: [UserRoles.ADMIN,UserRoles.DOCTOR],
        redirectTo: {
          [UserRoles.ADMIN]: 'admin',
          [UserRoles.DOCTOR]: 'doctor',
          default: 'login'
        }
      }
    }
  },

@AlexKhymenko
Copy link
Owner

A little bit didn't understand what exactly You mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants