diff --git a/sandbox/captcha/pom.xml b/sandbox/captcha/pom.xml index 4f9fef4d51..60daca12c0 100644 --- a/sandbox/captcha/pom.xml +++ b/sandbox/captcha/pom.xml @@ -16,14 +16,21 @@ spring-security-core ${project.version} + + org.springframework.security + spring-security-core + ${project.version} + tests + test + javax.servlet servlet-api - + org.springframework org.springframework.test test - + diff --git a/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplate.java b/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplate.java index 6326153cff..7f5369f757 100644 --- a/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplate.java +++ b/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplate.java @@ -16,7 +16,6 @@ package org.springframework.security.captcha; import org.springframework.security.ConfigAttribute; -import org.springframework.security.ConfigAttributeDefinition; import org.springframework.security.context.SecurityContextHolder; @@ -77,8 +76,7 @@ public abstract class CaptchaChannelProcessorTemplate implements ChannelProcesso Assert.hasLength(keyword, "keyword required"); } - public void decide(FilterInvocation invocation, ConfigAttributeDefinition config) - throws IOException, ServletException { + public void decide(FilterInvocation invocation, java.util.List config) throws IOException, ServletException { if ((invocation == null) || (config == null)) { throw new IllegalArgumentException("Nulls cannot be provided"); } @@ -86,7 +84,7 @@ public abstract class CaptchaChannelProcessorTemplate implements ChannelProcesso CaptchaSecurityContext context = null; context = (CaptchaSecurityContext) SecurityContextHolder.getContext(); - Iterator iter = config.getConfigAttributes().iterator(); + Iterator iter = config.iterator(); while (iter.hasNext()) { ConfigAttribute attribute = (ConfigAttribute) iter.next(); diff --git a/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaEntryPoint.java b/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaEntryPoint.java index 8b3c27f619..6a6ac74570 100644 --- a/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaEntryPoint.java +++ b/sandbox/captcha/src/main/java/org/springframework/security/captcha/CaptchaEntryPoint.java @@ -181,8 +181,7 @@ public class CaptchaEntryPoint implements ChannelEntryPoint, InitializingBean { } } - public void commence(ServletRequest request, ServletResponse response) - throws IOException, ServletException { + public void commence(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { StringBuffer redirectUrl = new StringBuffer(); HttpServletRequest req = (HttpServletRequest) request; diff --git a/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplateTests.java b/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplateTests.java index 09e4ad4994..914b8df2bd 100644 --- a/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplateTests.java +++ b/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaChannelProcessorTemplateTests.java @@ -17,7 +17,7 @@ package org.springframework.security.captcha; import junit.framework.TestCase; -import org.springframework.security.ConfigAttributeDefinition; +import org.springframework.security.ConfigAttribute; import org.springframework.security.SecurityConfig; import org.springframework.security.context.SecurityContextHolder; @@ -28,6 +28,7 @@ import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import java.io.IOException; +import java.util.List; import javax.servlet.ServletException; import javax.servlet.FilterChain; @@ -44,7 +45,7 @@ import javax.servlet.ServletResponse; public class CaptchaChannelProcessorTemplateTests extends TestCase { //~ Methods ======================================================================================================== - private MockHttpServletResponse decideWithNewResponse(ConfigAttributeDefinition cad, + private MockHttpServletResponse decideWithNewResponse(List cad, CaptchaChannelProcessorTemplate processor, MockHttpServletRequest request) throws IOException, ServletException { MockHttpServletResponse response; @@ -70,7 +71,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase { CaptchaChannelProcessorTemplate processor = new TestHumanityCaptchaChannelProcessor(); processor.setKeyword("X"); - ConfigAttributeDefinition cad = new ConfigAttributeDefinition("Y"); + List cad = SecurityConfig.createList("Y"); CaptchaSecurityContext context = new CaptchaSecurityContextImpl(); SecurityContextHolder.setContext(context); @@ -136,7 +137,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase { CaptchaChannelProcessorTemplate processor = new TestHumanityCaptchaChannelProcessor(); processor.setKeyword("X"); - ConfigAttributeDefinition cad = new ConfigAttributeDefinition("X"); + List cad = SecurityConfig.createList("X"); CaptchaSecurityContext context = new CaptchaSecurityContextImpl(); SecurityContextHolder.setContext(context); @@ -224,5 +225,5 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase { public void doFilter(ServletRequest arg0, ServletResponse arg1) throws IOException, ServletException { throw new UnsupportedOperationException("mock method not implemented"); } - } + } } diff --git a/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaValidationProcessingFilterTests.java b/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaValidationProcessingFilterTests.java index ef3477a474..7ed25a89a3 100644 --- a/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaValidationProcessingFilterTests.java +++ b/sandbox/captcha/src/test/java/org/springframework/security/captcha/CaptchaValidationProcessingFilterTests.java @@ -19,6 +19,7 @@ import junit.framework.TestCase; import org.springframework.security.context.SecurityContextHolder; +import org.springframework.security.util.MockFilter; import org.springframework.security.util.MockFilterChain; import org.springframework.mock.web.MockHttpServletRequest; diff --git a/sandbox/other/pom.xml b/sandbox/other/pom.xml index 6b073db7ad..a9d4771c5b 100644 --- a/sandbox/other/pom.xml +++ b/sandbox/other/pom.xml @@ -17,19 +17,26 @@ spring-security-core ${project.version} + + org.springframework.security + spring-security-core + ${project.version} + tests + test + org.springframework org.springframework.test true - org.springframework - spring-tx - + org.springframework + org.springframework.jdbc + true + org.springframework.ldap - spring-ldap - 1.2.1 + spring-ldap-core true @@ -45,27 +52,26 @@ org.aspectj - aspectjrt - 1.5.4 - true + com.springsource.org.aspectj.runtime org.aspectj - aspectjweaver - 1.5.4 - true - + com.springsource.org.aspectj.weaver + ldapsdk ldapsdk 4.1 + hsqldb hsqldb diff --git a/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java b/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java index 90d80db6f2..c75a799f8a 100644 --- a/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java +++ b/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java @@ -28,8 +28,8 @@ import netscape.ldap.ber.stream.BERSequence; import netscape.ldap.ber.stream.BERTag; import netscape.ldap.ber.stream.BERTagDecoder; -import org.springframework.security.ldap.LdapDataAccessException; import org.springframework.security.ldap.ppolicy.PasswordPolicyControl; +import org.springframework.dao.DataRetrievalFailureException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -98,7 +98,7 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl { try { decoder.decode(); } catch (IOException e) { - throw new LdapDataAccessException("Failed to parse control value", e); + throw new DataRetrievalFailureException("Failed to parse control value", e); } } @@ -107,8 +107,6 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl { /** * Returns the unchanged value of the response control. Returns the unchanged value of the response * control as byte array. - * - * @return DOCUMENT ME! */ public byte[] getEncodedValue() { return encodedValue; @@ -287,7 +285,7 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl { } } - throw new LdapDataAccessException("Unexpected tag " + tag); + throw new DataRetrievalFailureException("Unexpected tag " + tag); } private void setInChoice(boolean inChoice) { diff --git a/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapper.java b/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapper.java index f4f0939d9e..1a13342866 100644 --- a/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapper.java +++ b/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapper.java @@ -22,6 +22,8 @@ import org.springframework.security.GrantedAuthority; import org.springframework.security.userdetails.UserDetails; import org.springframework.util.Assert; +import java.util.List; + /** * Maps user (loaded from the primary user accounts repository, e.g. LDAP) to username in secondary * user accounts repository. Tries to find user's authority with name starting with @@ -53,9 +55,9 @@ public class AuthorityByPrefixAccountMapper implements AccountMapper, Initializi } // search authorities for authority prefix - GrantedAuthority[] authorities = user.getAuthorities(); - for (int i = 0; i < authorities.length; i++) { - String authority = authorities[i].getAuthority(); + List authorities = user.getAuthorities(); + for (int i = 0; i < authorities.size(); i++) { + String authority = authorities.get(i).getAuthority(); if (authority.startsWith(this.getAuthorityPrefix())) { if (this.logger.isDebugEnabled()) { this.logger.debug("Authority found=[" + authority + "]"); diff --git a/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapper.java b/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapper.java index 13cd1fd853..54f3bcc6c8 100644 --- a/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapper.java +++ b/sandbox/other/src/main/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapper.java @@ -26,6 +26,7 @@ import org.springframework.security.userdetails.UserDetails; import org.springframework.security.userdetails.UserDetailsService; import org.springframework.util.Assert; +import java.util.List; /** * The context mapper used by the LDAP authentication provider to create an LDAP user object. * Creates the final UserDetails object that will be returned by the provider once the @@ -95,7 +96,7 @@ public class ReplacingUserDetailsMapper extends LdapUserDetailsMapper implements * the user has been authenticated, replacing the original UserDetails object. */ public UserDetails mapUserFromContext(DirContextOperations ctx, String username, - GrantedAuthority[] authorities) { + List authorities) { UserDetails userOriginal = super.mapUserFromContext(ctx, username, authorities); if (this.logger.isDebugEnabled()) { diff --git a/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapperTest.java b/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapperTest.java index e22c12992d..64cfe7ab27 100644 --- a/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapperTest.java +++ b/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/AuthorityByPrefixAccountMapperTest.java @@ -1,5 +1,5 @@ /** - * + * */ package org.springframework.security.userdetails.ldap; @@ -10,16 +10,18 @@ import org.springframework.security.GrantedAuthorityImpl; import org.springframework.security.userdetails.User; import org.springframework.security.userdetails.UserDetails; +import java.util.*; + /** * @author Valery Tydykov - * + * */ public class AuthorityByPrefixAccountMapperTest extends TestCase { AuthorityByPrefixAccountMapper mapper; /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { @@ -28,7 +30,7 @@ public class AuthorityByPrefixAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { @@ -43,7 +45,7 @@ public class AuthorityByPrefixAccountMapperTest extends TestCase { String expectedAuthority = "prefix1_role1"; GrantedAuthority[] authorities = { new GrantedAuthorityImpl(expectedAuthority), new GrantedAuthorityImpl("prefix1_role2") }; - UserDetails user = new User("username1", "password1", false, authorities); + UserDetails user = new User("username1", "password1", false, false, false, false, Arrays.asList(authorities)); mapper.setAuthorityPrefix("prefix1_"); String authority = mapper.map(user); @@ -57,7 +59,7 @@ public class AuthorityByPrefixAccountMapperTest extends TestCase { public final void testAuthorityNotFoundThrowsException() { String expectedAuthority = "prefix1_role1"; GrantedAuthority[] authorities = { new GrantedAuthorityImpl(expectedAuthority) }; - UserDetails user = new User("username1", "password1", false, authorities); + UserDetails user = new User("username1", "password1", false, false, false, false, Arrays.asList(authorities)); mapper.setAuthorityPrefix("NoMatchPrefix"); try { diff --git a/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapperTest.java b/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapperTest.java index d148940baa..9d76c33887 100644 --- a/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapperTest.java +++ b/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/ReplacingUserDetailsMapperTest.java @@ -23,10 +23,11 @@ import org.springframework.security.userdetails.UsernameNotFoundException; import org.springframework.security.userdetails.memory.InMemoryDaoImpl; import org.springframework.security.userdetails.memory.UserMap; import org.springframework.security.userdetails.memory.UserMapEditor; +import org.springframework.security.util.AuthorityUtils; /** * @author Valery Tydykov - * + * */ public class ReplacingUserDetailsMapperTest extends TestCase { @@ -34,7 +35,7 @@ public class ReplacingUserDetailsMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { @@ -43,7 +44,7 @@ public class ReplacingUserDetailsMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { @@ -118,9 +119,9 @@ public class ReplacingUserDetailsMapperTest extends TestCase { ctx.setAttributeValues("userRole", new String[] { "X", "Y", "Z" }); ctx.setAttributeValue("uid", "ani"); - UserDetails userDetails = mapper.mapUserFromContext(ctx, "ani", new GrantedAuthority[0]); + UserDetails userDetails = mapper.mapUserFromContext(ctx, "ani", AuthorityUtils.NO_AUTHORITIES); // verify that userDetails came from the secondary repository - assertEquals("ROLE_ONE", userDetails.getAuthorities()[0].getAuthority()); + assertEquals("ROLE_ONE", userDetails.getAuthorities().get(0).getAuthority()); } /** @@ -141,7 +142,7 @@ public class ReplacingUserDetailsMapperTest extends TestCase { UserDetails userDetails = mapper.retrieveUser(username); - assertEquals("ROLE_ONE", userDetails.getAuthorities()[0].getAuthority()); + assertEquals("ROLE_ONE", userDetails.getAuthorities().get(0).getAuthority()); try { mapper.retrieveUser("noMatchUsername"); diff --git a/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/UsernameFromPropertyAccountMapperTest.java b/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/UsernameFromPropertyAccountMapperTest.java index dfda437670..3f824fd949 100644 --- a/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/UsernameFromPropertyAccountMapperTest.java +++ b/sandbox/other/src/test/java/org/springframework/security/userdetails/ldap/UsernameFromPropertyAccountMapperTest.java @@ -22,7 +22,7 @@ import org.springframework.security.userdetails.UserDetails; /** * @author Valery Tydykov - * + * */ public class UsernameFromPropertyAccountMapperTest extends TestCase { @@ -30,7 +30,7 @@ public class UsernameFromPropertyAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { @@ -39,7 +39,7 @@ public class UsernameFromPropertyAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { @@ -52,7 +52,7 @@ public class UsernameFromPropertyAccountMapperTest extends TestCase { */ public final void testNormalOperation() { String usernameExpected = "username1"; - UserDetails user = new User(usernameExpected, "password1", false, new GrantedAuthority[0]); + UserDetails user = new User(usernameExpected, "password1", false, false, false, false, new GrantedAuthority[0]); mapper.setUsername(usernameExpected); String username = mapper.map(user); diff --git a/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UserDetailsMappingServiceWrapperTest.java b/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UserDetailsMappingServiceWrapperTest.java index 2ca8f80201..5b282d4e1c 100644 --- a/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UserDetailsMappingServiceWrapperTest.java +++ b/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UserDetailsMappingServiceWrapperTest.java @@ -25,26 +25,16 @@ import org.springframework.security.userdetails.memory.UserMapEditor; /** * @author Valery Tydykov - * + * */ public class UserDetailsMappingServiceWrapperTest extends TestCase { UserDetailsMappingServiceWrapper service; - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ protected void setUp() throws Exception { service = new UserDetailsMappingServiceWrapper(); } - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#tearDown() - */ protected void tearDown() throws Exception { service = null; } @@ -84,11 +74,11 @@ public class UserDetailsMappingServiceWrapperTest extends TestCase { service.setUserDetailsService(dao); } - Authentication authentication = new TestingAuthenticationToken("any", "any", null); + Authentication authentication = new TestingAuthenticationToken("any", "any"); UserDetails user = service.loadUserDetails(authentication); // verify that userDetails came from the secondary repository - assertEquals("ROLE_ONE", user.getAuthorities()[0].getAuthority()); + assertEquals("ROLE_ONE", user.getAuthorities().get(0).getAuthority()); } /** diff --git a/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromPropertyAccountMapperTest.java b/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromPropertyAccountMapperTest.java index cda2b212d0..c21357df15 100644 --- a/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromPropertyAccountMapperTest.java +++ b/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromPropertyAccountMapperTest.java @@ -21,7 +21,7 @@ import org.springframework.security.providers.TestingAuthenticationToken; /** * @author Valery Tydykov - * + * */ public class UsernameFromPropertyAccountMapperTest extends TestCase { @@ -29,7 +29,7 @@ public class UsernameFromPropertyAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { @@ -38,7 +38,7 @@ public class UsernameFromPropertyAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { @@ -51,7 +51,7 @@ public class UsernameFromPropertyAccountMapperTest extends TestCase { */ public final void testNormalOperation() { String usernameExpected = "username1"; - Authentication authenticationRequest = new TestingAuthenticationToken("any", "any", null); + Authentication authenticationRequest = new TestingAuthenticationToken("any", "any"); mapper.setUsername(usernameExpected); String username = mapper.map(authenticationRequest); diff --git a/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromRequestAccountMapperTest.java b/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromRequestAccountMapperTest.java index b856974aa4..b0e53b2fe6 100644 --- a/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromRequestAccountMapperTest.java +++ b/sandbox/other/src/test/java/org/springframework/security/userdetails/preauth/UsernameFromRequestAccountMapperTest.java @@ -21,7 +21,7 @@ import org.springframework.security.providers.TestingAuthenticationToken; /** * @author Valery Tydykov - * + * */ public class UsernameFromRequestAccountMapperTest extends TestCase { @@ -29,7 +29,7 @@ public class UsernameFromRequestAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { @@ -38,7 +38,7 @@ public class UsernameFromRequestAccountMapperTest extends TestCase { /* * (non-Javadoc) - * + * * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { @@ -51,8 +51,7 @@ public class UsernameFromRequestAccountMapperTest extends TestCase { */ public final void testNormalOperation() { String usernameExpected = "username1"; - Authentication authenticationRequest = new TestingAuthenticationToken(usernameExpected, - "password1", null); + Authentication authenticationRequest = new TestingAuthenticationToken(usernameExpected, "password1"); String username = mapper.map(authenticationRequest); assertEquals(usernameExpected, username); diff --git a/sandbox/other/src/test/java/org/springframework/security/vote/FirstDecisionBased.java b/sandbox/other/src/test/java/org/springframework/security/vote/FirstDecisionBased.java index a180359089..c8aa858497 100644 --- a/sandbox/other/src/test/java/org/springframework/security/vote/FirstDecisionBased.java +++ b/sandbox/other/src/test/java/org/springframework/security/vote/FirstDecisionBased.java @@ -15,37 +15,37 @@ package org.springframework.security.vote; -import java.util.Iterator; +import java.util.*; import org.springframework.security.AccessDeniedException; import org.springframework.security.Authentication; -import org.springframework.security.ConfigAttributeDefinition; +import org.springframework.security.ConfigAttribute; /** * AccessDecisionManager which bases its result on the first non-abstention from - * its list of voters. - * - * @author Janning Vygen + * its list of voters. + * + * @author Janning Vygen */ public class FirstDecisionBased extends AbstractAccessDecisionManager { - public void decide(Authentication authentication, Object object, ConfigAttributeDefinition config ) throws AccessDeniedException { + public void decide(Authentication authentication, Object object, List config ) throws AccessDeniedException { Iterator voters = this.getDecisionVoters().iterator(); while (voters.hasNext()) { AccessDecisionVoter voter = (AccessDecisionVoter) voters.next(); int result = voter.vote(authentication, object, config); - + switch (result) { case AccessDecisionVoter.ACCESS_GRANTED: return; - + case AccessDecisionVoter.ACCESS_DENIED: throw new AccessDeniedException(messages.getMessage("AbstractAccessDecisionManager.accessDenied", "Access is denied")); } } - + // To get this far, every AccessDecisionVoter abstained checkAllowIfAllAbstainDecisions(); } -} \ No newline at end of file +}