Say I have a profile page, which has an 'edit your profile' link. The profile page can be viewed by all the users, but the edit link button should be visible only for a logged in user viewing his profile, not another user's profile.
As of now I have this code,
<sec:authorize access="isAuthenticated()">
<sec:authentication property="principal.username" var="principal"/>
<c:if test="${profile_username eq principal}"> <!--profile_username is the username of the viewed profile -->
<!-- edit your profile link -->
</c:if>
</sec:authorize>
Is there a cleaner way a doing this?? May be a one liner like
<sec:authorize access="isTheSamePerson()"/>
.
Thanks in advance. :)