Answer the question
In order to leave comments, you need to log in
How to limit the visibility of an element on the page depending on the role?
Greetings. I am writing a web application on Spring boot, Thymeleaf and faced the need to limit the visibility of some interface elements on the page. I have welcome.html, where for the admin I want to display elements for managing the CRUD entity of the software, and if the user role is not admin, then no.
Spring security is set up. The project can be viewed here https://github.com/MarkusEfr/Market.
How is this problem solved within this framework?
Answer the question
In order to leave comments, you need to log in
From documentation :
<div sec:authorize="hasRole('ROLE_ADMIN')">
This content is only shown to administrators.
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question