Java Code Examples for org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#setPermissionEvaluator()

The following examples show how to use org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#setPermissionEvaluator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebSecurityConfig.java    From blog-sample with Apache License 2.0 5 votes vote down vote up
/**
 * 将 DefaultPermissionEvaluator 配置进 DefaultWebSecurityExpressionHandler 中
 */
@Bean
public DefaultWebSecurityExpressionHandler webSecurityExpressionHandler(){
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setPermissionEvaluator(new DefaultPermissionEvaluator());
    return handler;
}
 
Example 2
Source File: WebSecurityConfig.java    From blog-sample with Apache License 2.0 5 votes vote down vote up
/**
 * 将 DefaultPermissionEvaluator 配置进 DefaultWebSecurityExpressionHandler 中
 */
@Bean
public DefaultWebSecurityExpressionHandler webSecurityExpressionHandler(){
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setPermissionEvaluator(new DefaultPermissionEvaluator());
    return handler;
}
 
Example 3
Source File: WebSecurityConfig.java    From blog-sample with Apache License 2.0 5 votes vote down vote up
/**
 * 注入自定义PermissionEvaluator
 */
@Bean
public DefaultWebSecurityExpressionHandler webSecurityExpressionHandler() {
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setPermissionEvaluator(new CustomPermissionEvaluator());
    return handler;
}