I have developed a webapp in Angular 2, backed by a set of RESTful services. Those RESTful services are all secured, and each endpoint requires authenticated user with one or more user roles. Different services can have different roles.
To consume these services, the webapp first authenticates the user, then a received JWT-token is sent in each request to the services. This token contains all the information about the user, such as username, roles etc.
Now, how can I easily present only those elements in my webapp which the logged inn user has acccess to. Are there any standard ways to that? Or are there any best-practices for that? I want to avoid hard-coding stuff in my webapp as much as possible.