0

I want to change some jsp pages in jasperserver, and all my need to know is :

the logged user, have ROLE_ADMINISTRATOR or not ?

thanks

1 Answers1

0

You can use tag authz:authorize in jsp file.

The example:

<authz:authorize ifAllGranted="ROLE_ADMINISTRATOR">

Or you can use condition in configuration files (xml) like in this sample:

<condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">

The snippet from decoratorCommonComponents.jsp file:

<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>
Alex K
  • 22,315
  • 19
  • 108
  • 236
  • unfortunately, it dosn't work , that's what I tried to do : in the file results.jsp (modules/search) I have :
    ...
    and don't need that div be displayed if the user haven't administrator role only so I tried
    ...
    and I tried also
    ...
    But it dosen't work I use jasperserver 4.5
    – Boussetta moez Apr 27 '12 at 14:05
  • You might need to add `<%@ taglib uri="http://www.springframework.org/security/tags" prefix="authz"%>` to the page so that it recognizes the authz prefix. – Logan5 Apr 27 '12 at 16:55
  • thank you very much this is exactly what I don't put :) I will ask you again if I have another problem. thanks again ;-) – Boussetta moez Apr 27 '12 at 17:13