Within Spring Boot 2.4 it is
sec:authorize="hasAnyRole('ROLE_ADMIN')
Ensure that you have
thymeleaf-extras-springsecurity5
in your dependencies. Also make sure that you include the namespace
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
in your html...