Package org.springframework.security.core.authority.mapping

Examples of org.springframework.security.core.authority.mapping.SimpleMappableAttributesRetriever


     *         {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource}
     *         to use.
     */
    private J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource createWebAuthenticationDetailsSource() {
        J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource detailsSource = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource();
        SimpleMappableAttributesRetriever rolesRetriever = new SimpleMappableAttributesRetriever();
        rolesRetriever.setMappableAttributes(mappableRoles);
        detailsSource.setMappableRolesRetriever(rolesRetriever);

        detailsSource = postProcess(detailsSource);
        return detailsSource;
    }
View Full Code Here


*/
public class SimpleMappableRolesRetrieverTests extends TestCase {

    public final void testGetSetMappableRoles() {
        Set<String> roles = StringUtils.commaDelimitedListToSet("Role1,Role2");
        SimpleMappableAttributesRetriever r = new SimpleMappableAttributesRetriever();
        r.setMappableAttributes(roles);
        Set<String> result = r.getMappableAttributes();
        assertTrue("Role collections do not match; result: " + result + ", expected: " + roles, roles.containsAll(result)
                && result.containsAll(roles));
    }
View Full Code Here

        }
        return result;
    }

    private MappableAttributesRetriever getMappableRolesRetriever(String[] mappedRoles) {
        SimpleMappableAttributesRetriever result = new SimpleMappableAttributesRetriever();
        result.setMappableAttributes(new HashSet<String>(Arrays.asList(mappedRoles)));
        return result;
    }
View Full Code Here

     *         {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource}
     *         to use.
     */
    private J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource createWebAuthenticationDetailsSource() {
        J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource detailsSource = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource();
        SimpleMappableAttributesRetriever rolesRetriever = new SimpleMappableAttributesRetriever();
        rolesRetriever.setMappableAttributes(mappableRoles);
        detailsSource.setMappableRolesRetriever(rolesRetriever);

        detailsSource = postProcess(detailsSource);
        return detailsSource;
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.core.authority.mapping.SimpleMappableAttributesRetriever

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.