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


Java WebExpressionVoter类代码示例

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


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

示例1: configureUrlAuthorization

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Override
protected void configureUrlAuthorization(
		ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry expressionInterceptUrlRegistry)
{
	@SuppressWarnings("rawtypes")
	List<AccessDecisionVoter> listOfVoters = new ArrayList<AccessDecisionVoter>();
	listOfVoters.add(new WebExpressionVoter());
	listOfVoters.add(new MolgenisAccessDecisionVoter());
	expressionInterceptUrlRegistry.accessDecisionManager(new AffirmativeBased(listOfVoters));

	expressionInterceptUrlRegistry.antMatchers("/").permitAll()
	// DAS datasource uses the database, unauthenticated users can
	// not see any data
			.antMatchers("/das/**").permitAll()

			.antMatchers("/myDas/**").permitAll()

			.antMatchers("/annotators/**").authenticated()

			.antMatchers("/charts/**").authenticated();
}
 
开发者ID:dennishendriksen,项目名称:molgenis-lifelines,代码行数:22,代码来源:WebAppSecurityConfig.java

示例2: accessDecisionManager

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Description("ConsensusBased AccessDecisionManager for Authorization voting")
    @Bean
    public AccessDecisionManager accessDecisionManager(
            CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
        List<AccessDecisionVoter<? extends Object>> decisionVoters
                = Arrays.asList(
//                new AuthenticatedVoter(),
//                new RoleVoter(),
                new WebExpressionVoter(){{
                    setExpressionHandler(customWebSecurityExpressionHandler);
                }}
        );
        return new ConsensusBased(decisionVoters);
    }
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:15,代码来源:CustomAuthorizationConfig.java

示例3: accessDecisionManager2

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
public AccessDecisionManager accessDecisionManager2(
        CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
    List<AccessDecisionVoter<? extends Object>> decisionVoters
            = Arrays.asList(
            new AuthenticatedVoter(),
            new RoleVoter(),
            new WebExpressionVoter(){{
                setExpressionHandler(customWebSecurityExpressionHandler);
            }}
    );
    return new UnanimousBased(decisionVoters);
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:CustomAuthorizationConfig.java

示例4: accessDecisionManager

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Description("AccessDecisionManager for Authorization voting")
@Bean
public AccessDecisionManager accessDecisionManager(
        CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
    List<AccessDecisionVoter<? extends Object>> decisionVoters
            = Arrays.asList(
            new WebExpressionVoter(){{
                setExpressionHandler(customWebSecurityExpressionHandler);
            }}
    );
    return new ConsensusBased(decisionVoters);
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:CustomAuthorizationConfig.java

示例5: accessDecisionManager

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Description("ConsensusBased AccessDecisionManager for Authorization voting")
@Bean
public AccessDecisionManager accessDecisionManager(
        CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
    List<AccessDecisionVoter<? extends Object>> decisionVoters
            = Arrays.asList(
            new WebExpressionVoter(){{
                setExpressionHandler(customWebSecurityExpressionHandler);
            }}
    );
    return new ConsensusBased(decisionVoters);
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:CustomAuthorizationConfig.java

示例6: checkUrlAccessExpression

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
private void checkUrlAccessExpression() {
   log.debug("check if URL access expressions are allowed");
   String[] names = context.getBeanDefinitionNames();
   for (String name : names) {
      if (context.getBean(name) instanceof AbstractAccessDecisionManager) {
         for (AccessDecisionVoter v : ((AbstractAccessDecisionManager) context.getBean(name)).getDecisionVoters()) {
            if (v instanceof WebExpressionVoter) {
               log.debug("parse urlAccess as EL expression");
               urlAccessExpression = true;
               return;
            }
         }
      }
   }

   log.debug("parse urlAccess as simple expression");
   urlAccessExpression = false;
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:19,代码来源:SpringSecurityActuator.java

示例7: filterInvocationInterceptor

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public FilterSecurityInterceptor filterInvocationInterceptor(){
    List<AccessDecisionVoter> vote = new ArrayList<AccessDecisionVoter>(Arrays.asList(new WebExpressionVoter()));
    AffirmativeBased voters = new AffirmativeBased(vote);
    voters.setAllowIfAllAbstainDecisions(false);
    FilterSecurityInterceptor bean = new FilterSecurityInterceptor();
    bean.setAuthenticationManager(authenticationManager());
    bean.setAccessDecisionManager(voters);
    bean.setSecurityMetadataSource(securityMetadataSource);
    bean.setMessageSource(messageSource);
    return bean;
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:13,代码来源:SecurityConfiguration.java

示例8: configureUrlAuthorization

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Override
protected void configureUrlAuthorization(
		ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry expressionInterceptUrlRegistry)
{
	List<AccessDecisionVoter<?>> listOfVoters = new ArrayList<>();
	listOfVoters.add(new WebExpressionVoter());
	listOfVoters.add(new MolgenisAccessDecisionVoter());
	expressionInterceptUrlRegistry.accessDecisionManager(new AffirmativeBased(listOfVoters));

	expressionInterceptUrlRegistry.antMatchers("/").permitAll().antMatchers("/fdp/**").permitAll()

								  .antMatchers("/annotators/**").authenticated()

								  .antMatchers("/charts/**").authenticated();
}
 
开发者ID:molgenis,项目名称:molgenis-bbmri-eric,代码行数:16,代码来源:WebAppSecurityConfig.java

示例9: create

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public static HandlerSecurityInterceptor create() {
  HandlerSecurityInterceptor interceptor = new HandlerSecurityInterceptor();
  WebExpressionVoterAdapter voter = new WebExpressionVoterAdapter(new WebExpressionVoter());
  AccessDecisionManager accessDecisionManager = new AffirmativeBased(Arrays.<AccessDecisionVoter> asList(voter));
  interceptor.setAccessDecisionManager(accessDecisionManager);
  interceptor.setSecurityMetadataSource(new ExpressionBasedHandlerInvocationSecurityMetadataSource());
  return interceptor;
}
 
开发者ID:mateuszwenus,项目名称:spring-security-controller-auth,代码行数:10,代码来源:HandlerSecurityInterceptor.java

示例10: configureUrlAuthorization

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Override
protected void configureUrlAuthorization(
		ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry expressionInterceptUrlRegistry)
{
	List<AccessDecisionVoter<?>> listOfVoters = new ArrayList<>();
	listOfVoters.add(new WebExpressionVoter());
	listOfVoters.add(new MolgenisAccessDecisionVoter());
	expressionInterceptUrlRegistry.accessDecisionManager(new AffirmativeBased(listOfVoters));

	expressionInterceptUrlRegistry.antMatchers("/").permitAll()

								  .antMatchers("/fdp/**").permitAll()

								  .antMatchers("/annotators/**").authenticated();
}
 
开发者ID:molgenis,项目名称:molgenis,代码行数:16,代码来源:WebAppSecurityConfig.java

示例11: webExpressionVoter

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public WebExpressionVoter webExpressionVoter() {
    WebExpressionVoter result = new WebExpressionVoter();
    result.setExpressionHandler(rbacWebSecurityExpressionHandler());
    return result;
}
 
开发者ID:melthaw,项目名称:spring-backend-boilerplate,代码行数:7,代码来源:OpenApiSecurityConfigurer.java

示例12: accessDecisionManager

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public AccessDecisionManager accessDecisionManager(){
	AffirmativeBased affirmative = new AffirmativeBased(Arrays.asList(multiWebExpressionVoter(), new WebExpressionVoter(), new AuthenticatedVoter()));
	return affirmative;
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:6,代码来源:UrlBasedSecurityConfig.java

示例13: webExpressionVoter

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

示例14: WebExpressionVoterAdapter

import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
public WebExpressionVoterAdapter(WebExpressionVoter webExpressionVoter) {
  this.webExpressionVoter = webExpressionVoter;
}
 
开发者ID:mateuszwenus,项目名称:spring-security-controller-auth,代码行数:4,代码来源:WebExpressionVoterAdapter.java


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