UdL-EPS-SoftArch / myroutes

0 stars 1 forks source link

Add route guard for actions just available for users (not admins) #20

Closed rogargon closed 10 months ago

rogargon commented 10 months ago

For instance, to fully block admins from creating Routes, beyond hiding the menu option it is possible to add a Guard to the route. You can use as inspiration: https://github.com/UdL-EPS-SoftArch/mycircular/blob/main/src/app/login-basic/adminLoggedIn.guard.ts

However, note that this guard should do the reverse, to check that the user is not in the role Admin.

dbistuer commented 10 months ago

I´ve been searching about canActivate and, have found that these method have been deprecated and now have to use canActivateFn

rogargon commented 10 months ago

Closed by #21