Motivation
Ease building client-side UX items, like some custom edit/admin toolbar
Related post and example code: https://www.drupal.org/project/lupus_decoupled/issues/3357878#comment-15...
When doing so, the question becomes: How much do we want to add to every response? We could also establish new endpoints for things like /userinfo or more site-information, possibly Drupal already offers some. But we might want to add some very basic information to the main response, which tells the frontend whether it's worth doing more requests or not.
Proposed resolution
One possible solution would be to offer some sort of configuration, a selection of permissons, and for those permissions we add the information whether the user has the permission or not the response.
Comments
Comment #2
glynster commentedI like the idea of some granular permissions are exposed options you can add to the API.
The simple solution of adding user info to the renderer made many things possible. Just on that level it helps with so much flexibility.
These guys have done some interesting stuff:
https://www.drupal.org/project/nuxtify
Mainly in regards to the API points for user info, sessions. Otherwise their approach is completely different.
Again always happy to help where I can!