0
嗨,我正在開發springboot項目,並將thymeleaf.extras.springsecurity4添加到了我的項目中。實際上,它已經工作了很長一段時間,但知道這是不是working.not工作部分是秒:授權=「hasRole(‘正常’)」的thymeleaf.extras.springsecurity4秒:授權不起作用
<p>Kontrol Paneli</p>
<span sec:authentication="name">Bob</span>
Roles: <span sec:authentication="principal.authorities">[ROLE_USER, ROLE_ADMIN]</span> |
<p sec:authorize="!hasRole('NORMAL')">I am here</p>
<p sec:authorize="!hasRole('ADMIN')">I am here</p>
</a></li>
顯示爲你看到秒代碼:授權不關心用戶具有哪個角色。