当前位置: 首页>>代码示例>>Java>>正文


Java ExpressionUtils类代码示例

本文整理汇总了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);
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:14,代码来源:SpringSecurityAuthenticationService.java

示例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);
}
 
开发者ID:u2ware,项目名称:springfield,代码行数:5,代码来源:AuthorityExpressionRoot.java


注:本文中的org.springframework.security.access.expression.ExpressionUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。