I would like to load a Spring Security attribute into a variable.
Variables:
- Boolean
editprovided in thePOSTbody (loading works fine) - Boolean
isSupervisorshould be true if the user has the role supervisor (I don’t know how to load it into an accessible variable. I’ve tried many different approaches and it didn’t work.)
Code:
//set somehow the isSupervisor variable
//var isSupervisor = hasRole('ROLE_SUPERVISOR')
<c:if test="${edit} and not isSupervisor">
... do something
</c:if>
i found this solution: