user1281598
user1281598

Reputation: 317

How would I check for a Granted Authority with Spring Security with the tag library?

I have a set of jQuery tabs. I only want some of these tags to show when they have the correct granted authority impl. Is it possible to check by using EL in the security tags, or do I need to add another role and check by that?

Upvotes: 0

Views: 373

Answers (1)

Shaun the Sheep
Shaun the Sheep

Reputation: 22742

Yes, you can use EL:

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

<sec:authorize access="hasRole('authority_name_you_want_to_check_for')">
   content conditional on having required authority
</sec:authorize>

Upvotes: 1

Related Questions