title: Different view by logged user (Spring, java, thymeleaf)
body: <p>I'm making a web application with spring and thymeleaf. My PM wants me to do a customizable view by each user (there will be a default - but every user can have a his own view). For example - after successful login there is a view with 4 buttons. To the app can log in 2 users, User1 and User2. User1 can only see 2 buttons, User 2 can see all of them. How can i do that? </p>
  
  <p>I was thinking about 2 options:</p>
  
  <ol>
  <li><p><code>ViewResolvers</code>. For example  <code>InternalResourceViewResolver</code> - but, can it be scoped by session? If i would have all the html files in directories User1/... 
  User2/... 
  would <code>InternalResourceViewResolver</code> (after successful login) choose what views it should use ? </p></li>
  <li><p>Use user roles (spring security). After login, set in session all the settings and then on the view check if user can see it or no (<code>th:if</code>). </p></li>
  </ol>
  
  <p>Please for any help, source of information or what should i read to find right solution. </p>