本文整理汇总了Java中org.springframework.security.access.expression.ExpressionUtils类的典型用法代码示例。如果您正苦于以下问题:Java ExpressionUtils类的具体用法?Java ExpressionUtils怎么用?Java ExpressionUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionUtils类属于org.springframework.security.access.expression包,在下文中一共展示了ExpressionUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decide
import org.springframework.security.access.expression.ExpressionUtils; //导入依赖的package包/类
@Override
public Mono<Boolean> decide(Authentication authentication, ServerWebExchange object, Flux<ConfigAttribute> configAttributes) {
ConfigAttribute attribute = configAttributes.blockFirst();
EvaluationContext context = handler.createEvaluationContext(authentication, object);
Expression expression = handler.getExpressionParser().parseExpression(attribute.getAttribute());
return Mono.just(ExpressionUtils.evaluateAsBoolean(expression, context));
}
开发者ID:guilhebl,项目名称:item-shop-reactive-backend,代码行数:8,代码来源:ExpressionReactiveAccessDecisionManager.java
示例2: evaluateExpression
import org.springframework.security.access.expression.ExpressionUtils; //导入依赖的package包/类
@Override
public boolean evaluateExpression(final String spel) {
final org.springframework.expression.ExpressionParser parser = SECURITY_EXPRESSION_HANDLER
.getExpressionParser();
final org.springframework.expression.Expression exp = parser.parseExpression(spel, PARSER_CONTEXT);
final HttpServletRequest request = RequestCycles.getContainerRequest();
final HttpServletResponse response = RequestCycles.getContainerResponse();
final Authentication authentication = getAuthentication();
final FilterInvocation invocation = new FilterInvocation(request, response, FILTER_CHAIN);
final org.springframework.expression.EvaluationContext ctx = SECURITY_EXPRESSION_HANDLER
.createEvaluationContext(authentication, invocation);
return ExpressionUtils.evaluateAsBoolean(exp, ctx);
}
示例3: evaluateAsBoolean
import org.springframework.security.access.expression.ExpressionUtils; //导入依赖的package包/类
public boolean evaluateAsBoolean(String authorizeExpressionString){
Expression authorizeExpression = parser.parseExpression(authorizeExpressionString);
return ExpressionUtils.evaluateAsBoolean(authorizeExpression, ctx);
}