You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<divsec:authorize="hasRole('ROLE_ADMIN')">
This content is only shown to administrators.
</div>
但是会报错,似乎是WebFlux不支持这种方式。
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Authorization-oriented expressions (such as those in 'sec:authorize') are restricted in WebFlux applications due to a lack of support in the reactive side of Spring Security (as of Spring Security 5.1). Only a minimal set of security expressions is allowed: [isAuthenticated(), isFullyAuthenticated(), isAnonymous(), isRememberMe()]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
希望实现页面元素根据用户角色控制是否显示的效果。
根据Thymeleaf文档,可以通过下面的方式:
但是会报错,似乎是WebFlux不支持这种方式。
网上没有找到可行的方案,请问有没有什么实现的思路?
PS: 当前使用的Halo版本:2.16.0
Beta Was this translation helpful? Give feedback.
All reactions