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

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

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

AffirmativeBased.setAllowIfAllAbstainDecisions介绍

暂无

代码示例

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

@Test
  public void testThreeAbstainVotesGrantsAccessIfAllowIfAllAbstainDecisionsIsSet()
      throws Exception {
    mgr = new AffirmativeBased(Arrays.<AccessDecisionVoter<? extends Object>> asList(
        abstain, abstain, abstain));
    mgr.setAllowIfAllAbstainDecisions(true);
    assertThat(mgr.isAllowIfAllAbstainDecisions()).isTrue(); // check changed

    mgr.decide(user, new Object(), attrs);
  }
}

代码示例来源:origin: geoserver/geoserver

voters.add(new AuthenticatedVoter());
AffirmativeBased accessDecisionManager = new AffirmativeBased(voters);
accessDecisionManager.setAllowIfAllAbstainDecisions(
    siConfig.isAllowIfAllAbstainDecisions());
filter.setAccessDecisionManager(accessDecisionManager);

代码示例来源:origin: psi-probe/psi-probe

/**
 * Gets the affirmative based.
 *
 * @return the affirmative based
 */
@Bean(name = "httpRequestAccessDecisionManager")
public AffirmativeBased getAffirmativeBased() {
 List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
 decisionVoters.add(getRoleVoter());
 AffirmativeBased based = new AffirmativeBased(decisionVoters);
 based.setAllowIfAllAbstainDecisions(false);
 return based;
}

代码示例来源:origin: sk.seges.acris/acris-security-spring

@Bean
  public AffirmativeBased AffirmativeAccessDecisionManager() {
    AffirmativeBased decisionManager = new AffirmativeBased();
    decisionManager.setAllowIfAllAbstainDecisions(false);
    
    List<AccessDecisionVoter> decissionVoters = new ArrayList<AccessDecisionVoter>();
    decissionVoters.add(roleVoter());
    decisionManager.setDecisionVoters(decissionVoters);
    
    return decisionManager;
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

/**
 * Configures access decision manager.
 */
@Bean
@ConditionalOnMissingBean
public AffirmativeBased accessDecisionManager() {
  AffirmativeBased accessManager = new AffirmativeBased(
      Collections.<AccessDecisionVoter<? extends Object>>singletonList(new RoleVoter()));
  accessManager.setAllowIfAllAbstainDecisions(true);
  return accessManager;
}

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

public AffirmativeBased accessDecisionManager() {
  AffirmativeBased affirmativeBased = new AffirmativeBased(Arrays.asList((AccessDecisionVoter) webExpressionVoter()));
  affirmativeBased.setAllowIfAllAbstainDecisions(false);
  return affirmativeBased;

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

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

相关文章