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

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

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

AffirmativeBased.setDecisionVoters介绍

暂无

代码示例

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

AffirmativeBased adm = new AffirmativeBased();
adm.setDecisionVoters(voters);

代码示例来源: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: spring-projects/spring-flex

private void configureDefaultAccessDecisionManager() {
  AffirmativeBased adm = new AffirmativeBased();
  List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
  voters.add(new RoleVoter());
  voters.add(new AuthenticatedVoter());
  adm.setDecisionVoters(voters);
  setAccessDecisionManager(adm);
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-spring-security

@Init
public void init() throws SecurityInitException {
  if (getDecisionVoters() == null || getDecisionVoters().isEmpty()) {
    List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
    RoleVoter roleVoter = new RoleVoter();
    voters.add(roleVoter);
    AuthenticatedVoter authenticatedVoter = new AuthenticatedVoter();
    voters.add(authenticatedVoter);
    setDecisionVoters(voters);
  }
  if ("affirmative".equals(managerType)) {
    AffirmativeBased affirmativeBased = new AffirmativeBased();
    affirmativeBased.setDecisionVoters(getDecisionVoters());
    delegate = affirmativeBased;
  } else if ("consensus".equals(managerType)) {
    ConsensusBased consensusBased = new ConsensusBased();
    consensusBased.setDecisionVoters(getDecisionVoters());
    delegate = consensusBased;
  } else if ("unanimous".equals(managerType)) {
    UnanimousBased unanimousBased = new UnanimousBased();
    unanimousBased.setDecisionVoters(getDecisionVoters());
    delegate = unanimousBased;
  } else {
    throw new SecurityInitException("Unknown access decision manager type: " + managerType);
  }
}

相关文章