ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

need to add multiple roles #526

Closed RajasekharKadasani closed 4 years ago

RajasekharKadasani commented 4 years ago

trying to create a app with ngx-rocket: after login i need to route based on role, ex:-
login as admin i need to show admin-dashboard if login as user neeed to show user-dashbord

as if now in shell how to use this tio manage multiple roles differnt start up page,every route i am making as module

sinedied commented 4 years ago

Look at LoginComponent, this is where the redirection is done:

      log.debug(`${credentials.username} successfully logged in`);
      this.router.navigate([ this.route.snapshot.queryParams.redirect || '/'], { replaceUrl: true });

Mananing different roles and behavior is something you have to manage yourself, you can use libraries like https://www.npmjs.com/package/ngx-permissions to help you with that.

RajasekharKadasani commented 4 years ago

thank you