How to mention not of hasRole('ROLE_ADMIN') in spring security taglib

走远了吗. 提交于 2019-12-20 17:29:02

问题


How would I write following condition using spring security taglib?

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authorize access="not of hasRole('ROLE_ADMIN')">
   <div> show these for only non admins </div>
</sec:authorize>

回答1:


<sec:authorize access="!hasRole('ROLE_ADMIN')">
   <div> show these for only non admins </div>
</sec:authorize>


来源:https://stackoverflow.com/questions/19311104/how-to-mention-not-of-hasrolerole-admin-in-spring-security-taglib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!