@Bean public AccessDecisionManager shellAccessDecisionManager() { List<AccessDecisionVoter<?>> voters = new ArrayList<AccessDecisionVoter<?>>(); RoleVoter voter = new RoleVoter(); voter.setRolePrefix(""); voters.add(voter); return new UnanimousBased(voters); }
@Bean public AccessDecisionManager accessDecisionManager() { List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>(); RoleVoter voter = new RoleVoter(); voter.setRolePrefix(""); voters.add(voter); AccessDecisionManager result = new UnanimousBased(voters); return result; }
@Bean public SecurityController authorityConfigurableSecurityController() { AuthorityConfigurableSecurityController authorityConfigurableSecurityController = new AuthorityConfigurableSecurityController(); Map<String, String> idAuthorityMap = Maps.newHashMap(); configureAuthorityMap(idAuthorityMap); authorityConfigurableSecurityController.setIdAuthorityMap(idAuthorityMap); AffirmativeBased accessDecisionManager = new AffirmativeBased(); RoleVoter roleVoter = new RoleVoter(); roleVoter.setRolePrefix(""); accessDecisionManager.setDecisionVoters(Lists.<AccessDecisionVoter>newArrayList(roleVoter)); authorityConfigurableSecurityController.setAccessDecisionManager(accessDecisionManager); return authorityConfigurableSecurityController; }