I want to check if user has some role permission and I want to check it using if else statement. I wrote this and it is not working,
<s:if test="%{hasRole('SOME_ROLE') == 1}">
<input type="hidden" id='isHasRole' value = 'true'>
</s:if>
<s:else>
<input type="hidden" id='isHasRole' value = 'false'>
</s:else>
It always gives false. Can anyone help me on this. Thanks.
Try this,
<sec:authorize
access="hasRole('SOME_ROLE')">
<input type="hidden" id='isHasRole' value = 'true'>
</sec:authorize>
when there is no permission for user it returns "undefine".