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


Java DefaultWebSecurityExpressionHandler类代码示例

本文整理汇总了Java中org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler的典型用法代码示例。如果您正苦于以下问题:Java DefaultWebSecurityExpressionHandler类的具体用法?Java DefaultWebSecurityExpressionHandler怎么用?Java DefaultWebSecurityExpressionHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DefaultWebSecurityExpressionHandler类属于org.springframework.security.web.access.expression包,在下文中一共展示了DefaultWebSecurityExpressionHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postProcessAfterInitialization

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:zzqfsy,项目名称:spring-jwt-starter,代码行数:24,代码来源:DefaultRolesPrefixPostProcessor.java

示例2: postProcessAfterInitialization

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:oasp,项目名称:oasp-tutorial-sources,代码行数:20,代码来源:DefaultRolesPrefixPostProcessor.java

示例3: postProcessAfterInitialization

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:27,代码来源:DefaultRolesPrefixPostProcessor.java

示例4: postProcessAfterInitialization

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:apache,项目名称:syncope,代码行数:21,代码来源:DefaultRolesPrefixPostProcessor.java

示例5: postProcessAfterInitialization

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:jpaoletti,项目名称:java-presentation-manager-2,代码行数:19,代码来源:DefaultRolesPrefixPostProcessor.java

示例6: webExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
/**
 * JSP / Thymeleaf Permissions
 */
@Bean
public DefaultWebSecurityExpressionHandler webExpressionHandler(){
    return new DefaultWebSecurityExpressionHandler(){{
        setPermissionEvaluator(permissionEvaluator());
    }};
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:10,代码来源:AclConfig.java

示例7: expressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:12,代码来源:SecurityConfiguration.java

示例8: configure

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
        }
    });
}
 
开发者ID:EMBL-EBI-SUBS-OLD,项目名称:subs,代码行数:12,代码来源:TestWebSecurityConfig.java

示例9: webExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setDefaultRolePrefix("");
    return defaultWebSecurityExpressionHandler;
}
 
开发者ID:zzqfsy,项目名称:spring-jwt-starter,代码行数:6,代码来源:WebSecurityConfig.java

示例10: webSecurityExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Bean
public SecurityExpressionHandler<FilterInvocation> webSecurityExpressionHandler(RoleHierarchy roleHierarchy) {
    final DefaultWebSecurityExpressionHandler handler = new CustomWebSecurityExpressionHandler();
    handler.setRoleHierarchy(roleHierarchy);
    return handler;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:7,代码来源:WebSecurityConfig.java

示例11: getWebExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Bean
public DefaultWebSecurityExpressionHandler getWebExpressionHandler() {
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setPermissionEvaluator(getPermissionEvaluator());
    return handler;
}
 
开发者ID:Wangzr,项目名称:micro-service-framework,代码行数:7,代码来源:WebConfiguration.java

示例12: webExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy);
    return defaultWebSecurityExpressionHandler;
}
 
开发者ID:rajadilipkolli,项目名称:springsecuredthymeleafapp,代码行数:6,代码来源:SecurityConfiguration.java

示例13: webExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());
    return defaultWebSecurityExpressionHandler;
}
 
开发者ID:MaritimeConnectivityPlatform,项目名称:IdentityRegistry,代码行数:6,代码来源:MultiSecurityConfig.java

示例14: webexpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Bean
public DefaultWebSecurityExpressionHandler webexpressionHandler(){
	return new DefaultWebSecurityExpressionHandler(); 
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:5,代码来源:SecurityConfiguration.java

示例15: webExpressionHandler

import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
    DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
    handler.setRoleHierarchy(roleHierarchy());
    return handler;
}
 
开发者ID:AreaFiftyLAN,项目名称:lancie-api,代码行数:6,代码来源:SecurityConfiguration.java


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