Route Guards for access control
Route Guards help guard access to one or more server resources (features, functionality, and data). Routes which are guarded will require the user to authenticate and get authorized before he/she can get access to the features/functionality being rendered as one or more components. One or more guards can be applied at any route level. Route Guards are supported using the following interfaces:
CanActivate
: This guards navigation to a route. TheÂCanActivate
interface can be used to handle scenarios such as allowing users to access the resources only after login-based authentication or role-based permissions. Users can be blocked or allowed limited access to resources until he/she has a sufficient role, and he/she has been authenticated. Anonymous users will be redirected to the login page if they try to access the access-controlled resources.CanActivateChild
: This guards navigation to a child route. As with theÂCanActivate
interface, theÂCanActivateChild
interface...