Example usage for org.springframework.security.access.expression SecurityExpressionOperations isRememberMe

List of usage examples for org.springframework.security.access.expression SecurityExpressionOperations isRememberMe

Introduction

In this page you can find the example usage for org.springframework.security.access.expression SecurityExpressionOperations isRememberMe.

Prototype

boolean isRememberMe();

Source Link

Document

Determines if the #getAuthentication() was authenticated using remember me

Usage

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  a v  a 2 s  .c om
 */
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");
}