我想在jasperserver中更改一些jsp页面, 我需要知道的是:
已登录的用户是否有ROLE_ADMINISTRATOR?
感谢
答案 0 :(得分:0)
您可以在jsp文件中使用 authz:authorize
标记。
示例:
<authz:authorize ifAllGranted="ROLE_ADMINISTRATOR">
或者您可以在配置文件(xml)中使用条件,如下例所示:
<condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">
decoratorCommonComponents.jsp 文件的片段:
<authz:authorize ifAnyGranted="ROLE_ADMINISTRATOR">
<li id="main_logOut" class="last"><a id="main_logOut_link" href="#" onclick="javascript:return false;"><spring:message code="menu.logout"/></a></li>
</authz:authorize>