Note that there are some explanatory texts on larger screens.

plurals
  1. POConditional field visibility for Spring MVC Rest Resource
    primarykey
    data
    text
    <p>Well first i would like to mention about the architecture a little bit.</p> <p>We have a UI application that uses a REST api for all the operations and use cases. UI application uses credentials to call REST api, since there are other non-UI application consuming same services.</p> <p>We do authentication and authorization on REST api application using Spring Security. In fact whole application uses Spring portfolio from top to bottom. </p> <p>For authentication and authorization of operations on UI application we also use Spring Security. We protect urls and display the currently logged in user only the operations that he is authorized to do.</p> <p>Here is the new requirement: Some logged in users see a resource with restrictions. That mean same resource is shown with fewer fields or fewer updatable fields.</p> <p>Exploring around, we narrowed down to two methods:</p> <ul> <li>Use different representation for each restricted access. Based on some HTTP header set and known by client.</li> <li>Use different resources for each restricted access.</li> </ul> <p>If the resource-representation combinations are too much, different resource object may be less maintainable. An automated HTTP-header based restrictor aspect can be implemented. Also client have provide some header and this add minor complexity to the client.</p> <p>If combinations are not too much, a new resource is created for each restricted access. Client have to call the right one at the right time. This approach can reveal hidden domain concepts as new resources and design may look more clean.</p> <p>What are your thoughts? Which approach would you take?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload