org.springframework.security.access.vote.AffirmativeBased.afterPropertiesSet()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.springframework.security.access.vote.AffirmativeBased.afterPropertiesSet()方法的一些代码示例,展示了AffirmativeBased.afterPropertiesSet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AffirmativeBased.afterPropertiesSet()方法的具体详情如下:
包路径:org.springframework.security.access.vote.AffirmativeBased
类名称:AffirmativeBased
方法名:afterPropertiesSet

AffirmativeBased.afterPropertiesSet介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-security

@Test
public void oneAffirmativeVoteOneDenyVoteOneAbstainVoteGrantsAccess()
    throws Exception {
  mgr = new AffirmativeBased(Arrays.<AccessDecisionVoter<? extends Object>> asList(
      grant, deny, abstain));
  mgr.afterPropertiesSet();
  mgr.decide(user, new Object(), attrs);
}

代码示例来源:origin: spring-projects/spring-integration

@SuppressWarnings("rawtypes")
private static ChannelSecurityInterceptor createInterceptor(String role) throws Exception {
  ChannelSecurityMetadataSource securityMetadataSource = new ChannelSecurityMetadataSource();
  securityMetadataSource.addPatternMapping(Pattern.compile("secured.*"), new DefaultChannelAccessPolicy(role, null));
  ChannelSecurityInterceptor interceptor = new ChannelSecurityInterceptor(securityMetadataSource);
  AffirmativeBased accessDecisionManager = AffirmativeBased.class.getConstructor(List.class)
      .newInstance(Collections.singletonList(new RoleVoter()));
  accessDecisionManager.afterPropertiesSet();
  interceptor.setAccessDecisionManager(accessDecisionManager);
  interceptor.setAuthenticationManager(new MockAuthenticationManager(true));
  interceptor.afterPropertiesSet();
  return interceptor;
}

代码示例来源:origin: stackoverflow.com

AffirmativeBased affirmativeBased = new AffirmativeBased(voters);
affirmativeBased.setAllowIfAllAbstainDecisions(false);
affirmativeBased.afterPropertiesSet();

相关文章