List of usage examples for org.springframework.security.access.expression SecurityExpressionOperations hasRole
boolean hasRole(String role);
Determines if the #getAuthentication() has a particular authority within Authentication#getAuthorities() .
From source file:de.iew.framework.security.access.WebResourceAccessEvaluator.java
/** * Evaluate the {@link HasAuthorityConfigAttribute} instance. * * @param authentication the authentication * @param filterInvocation the filter invocation * @param hasAuthorityConfigAttribute the has authority config attribute * @return the boolean/*from ww w .j a v a2 s.c om*/ */ public boolean evaluate(Authentication authentication, FilterInvocation filterInvocation, HasAuthorityConfigAttribute hasAuthorityConfigAttribute) { SecurityExpressionOperations ops = createSecurityExpressionRoot(authentication, filterInvocation); return ops.hasRole(hasAuthorityConfigAttribute.getAttribute()); }