1 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package org.springframework.security.ldap; 17 18 import org.springframework.security.GrantedAuthority; 19 20 import org.springframework.ldap.core.DirContextOperations; 21 22 23 /** 24 * Obtains a list of granted authorities for an Ldap user. 25 * <p> 26 * Used by the <tt>LdapAuthenticationProvider</tt> once a user has been 27 * authenticated to create the final user details object. 28 * </p> 29 * 30 * @author Luke Taylor 31 * @version $Id: LdapAuthoritiesPopulator.java 3036 2008-05-06 14:43:52Z luke_t $ 32 */ 33 public interface LdapAuthoritiesPopulator { 34 //~ Methods ======================================================================================================== 35 36 /** 37 * Get the list of authorities for the user. 38 * 39 * @param userData the context object which was returned by the LDAP authenticator. 40 * 41 * @return the granted authorities for the given user. 42 * 43 */ 44 GrantedAuthority[] getGrantedAuthorities(DirContextOperations userData, String username); 45 }