Java 类org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler 实例源码

项目:spring-jwt-starter    文件:DefaultRolesPrefixPostProcessor.java   
@Override
public Object postProcessAfterInitialization(Object bean, String beanName)
    throws BeansException {

    // remove this if you are not using JSR-250
    if(bean instanceof Jsr250MethodSecurityMetadataSource) {
        ((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(null);
    }

    if(bean instanceof DefaultMethodSecurityExpressionHandler) {
        ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if(bean instanceof DefaultWebSecurityExpressionHandler) {
        ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if(bean instanceof SecurityContextHolderAwareRequestFilter) {
        ((SecurityContextHolderAwareRequestFilter)bean).setRolePrefix("");
    }
    if(bean instanceof RoleVoter){
        ((RoleVoter) bean).setRolePrefix("");
    }
    return bean;
}
项目:oasp-tutorial-sources    文件:DefaultRolesPrefixPostProcessor.java   
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {

  // remove this if you are not using JSR-250
  if (bean instanceof Jsr250MethodSecurityMetadataSource) {
    ((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(this.rolePrefix);
  }

  if (bean instanceof DefaultMethodSecurityExpressionHandler) {
    ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(this.rolePrefix);
  }
  if (bean instanceof DefaultWebSecurityExpressionHandler) {
    ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(this.rolePrefix);
  }
  if (bean instanceof SecurityContextHolderAwareRequestFilter) {
    ((SecurityContextHolderAwareRequestFilter) bean).setRolePrefix(this.rolePrefix);
  }
  return bean;
}
项目:dhis2-core    文件:DefaultRolesPrefixPostProcessor.java   
@Override
public Object postProcessAfterInitialization( Object bean, String beanName )
    throws BeansException
{
    if ( bean instanceof Jsr250MethodSecurityMetadataSource )
    {
        ((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix( null );
    }

    if ( bean instanceof DefaultMethodSecurityExpressionHandler )
    {
        ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix( null );
    }

    if ( bean instanceof DefaultWebSecurityExpressionHandler )
    {
        ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix( null );
    }

    if ( bean instanceof SecurityContextHolderAwareRequestFilter )
    {
        ((SecurityContextHolderAwareRequestFilter) bean).setRolePrefix( "" );
    }

    return bean;
}
项目:syncope    文件:DefaultRolesPrefixPostProcessor.java   
@Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) {
    if (bean instanceof DefaultMethodSecurityExpressionHandler) {
        ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if (bean instanceof DefaultWebSecurityExpressionHandler) {
        ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if (bean instanceof SecurityContextHolderAwareRequestFilter) {
        SecurityContextHolderAwareRequestFilter filter = (SecurityContextHolderAwareRequestFilter) bean;
        filter.setRolePrefix(StringUtils.EMPTY);
        try {
            filter.afterPropertiesSet();
        } catch (ServletException e) {
            throw new FatalBeanException(e.getMessage(), e);
        }
    }

    return bean;
}
项目:java-presentation-manager-2    文件:DefaultRolesPrefixPostProcessor.java   
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    // remove this if you are not using JSR-250
    if (bean instanceof Jsr250MethodSecurityMetadataSource) {
        ((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(null);
    }

    if (bean instanceof DefaultMethodSecurityExpressionHandler) {
        ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if (bean instanceof DefaultWebSecurityExpressionHandler) {
        ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if (bean instanceof SecurityContextHolderAwareRequestFilter) {
        ((SecurityContextHolderAwareRequestFilter) bean).setRolePrefix("");
    }
    return bean;
}
项目:Spring-Security-Third-Edition    文件:AclConfig.java   
/**
 * JSP / Thymeleaf Permissions
 */
@Bean
public DefaultWebSecurityExpressionHandler webExpressionHandler(){
    return new DefaultWebSecurityExpressionHandler(){{
        setPermissionEvaluator(permissionEvaluator());
    }};
}
项目:Spring-Security-Third-Edition    文件:AclConfig.java   
/**
 * JSP / Thymeleaf Permissions
 */
@Bean
public DefaultWebSecurityExpressionHandler webExpressionHandler(){
    return new DefaultWebSecurityExpressionHandler(){{
        setPermissionEvaluator(permissionEvaluator());
    }};
}
项目:SMSC    文件:SecurityConfiguration.java   
/**
 * Gets the {@link SecurityExpressionHandler} which is used for role hierarchy definition
 *
 * @return authenticationTokenFilter
 */
private SecurityExpressionHandler<FilterInvocation> expressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());

    return defaultWebSecurityExpressionHandler;
}
项目:subs    文件:TestWebSecurityConfig.java   
@Override
public void configure(WebSecurity web) throws Exception {
    web.expressionHandler(new DefaultWebSecurityExpressionHandler() {
        @Override
        protected SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, FilterInvocation fi) {
            WebSecurityExpressionRoot root = (WebSecurityExpressionRoot) super.createSecurityExpressionRoot(authentication, fi);
            //root.setDefaultRolePrefix(""); //remove the prefix ROLE_
            return root;
        }
    });
}
项目:spring-jwt-starter    文件:WebSecurityConfig.java   
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setDefaultRolePrefix("");
    return defaultWebSecurityExpressionHandler;
}
项目:oma-riista-web    文件:WebSecurityConfig.java   
@Bean
public SecurityExpressionHandler<FilterInvocation> webSecurityExpressionHandler(RoleHierarchy roleHierarchy) {
    final DefaultWebSecurityExpressionHandler handler = new CustomWebSecurityExpressionHandler();
    handler.setRoleHierarchy(roleHierarchy);
    return handler;
}
项目:micro-service-framework    文件:WebConfiguration.java   
@Bean
public DefaultWebSecurityExpressionHandler getWebExpressionHandler() {
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setPermissionEvaluator(getPermissionEvaluator());
    return handler;
}
项目:springsecuredthymeleafapp    文件:SecurityConfiguration.java   
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy);
    return defaultWebSecurityExpressionHandler;
}
项目:IdentityRegistry    文件:MultiSecurityConfig.java   
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());
    return defaultWebSecurityExpressionHandler;
}
项目:IdentityRegistry    文件:MultiSecurityConfig.java   
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());
    return defaultWebSecurityExpressionHandler;
}
项目:coj-web    文件:SecurityConfiguration.java   
@Bean
public DefaultWebSecurityExpressionHandler webexpressionHandler(){
    return new DefaultWebSecurityExpressionHandler(); 
}
项目:lancie-api    文件:SecurityConfiguration.java   
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setRoleHierarchy(roleHierarchy());
    return handler;
}