List of usage examples for org.springframework.security.access.expression SecurityExpressionOperations isAnonymous
boolean isAnonymous();
From source file:de.iew.framework.security.access.WebResourceAccessEvaluator.java
/** * Evaluate the {@link FlagConfigAttribute} instance. * * @param authentication the authentication * @param filterInvocation the filter invocation * @param flagConfigAttribute the flag config attribute * @return the boolean//from w w w.j av a 2 s. com */ public boolean evaluate(Authentication authentication, FilterInvocation filterInvocation, FlagConfigAttribute flagConfigAttribute) { SecurityExpressionOperations ops = createSecurityExpressionRoot(authentication, filterInvocation); if (flagConfigAttribute.isAnonymous()) { return ops.isAnonymous(); } else if (flagConfigAttribute.isPermitAll()) { return ops.permitAll(); } else if (flagConfigAttribute.isDenyAll()) { return ops.denyAll(); } else if (flagConfigAttribute.isRememberMe()) { return ops.isRememberMe(); } else if (flagConfigAttribute.isAuthenticated()) { return ops.isAuthenticated(); } else if (flagConfigAttribute.isFullyAuthenticated()) { return ops.isFullyAuthenticated(); } throw new IllegalArgumentException("Illegal flag config attribute: All flags are false"); }