diff --git a/core/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java b/core/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java index a71030868c..ae9a555e47 100644 --- a/core/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java +++ b/core/src/main/java/org/springframework/security/ldap/populator/DefaultLdapAuthoritiesPopulator.java @@ -69,13 +69,13 @@ import java.util.Set; *
* <bean id="ldapAuthoritiesPopulator" * class="org.springframework.security.providers.ldap.populator.DefaultLdapAuthoritiesPopulator"> - * <constructor-arg><ref local="contextSource"/></constructor-arg> - * <constructor-arg><value>ou=groups</value></constructor-arg> - * <property name="groupRoleAttribute"><value>ou</value></property> + * <constructor-arg ref="contextSource"/> + * <constructor-arg value="ou=groups"/> + * <property name="groupRoleAttribute" value="ou"/> * <!-- the following properties are shown with their default values --> - * <property name="searchSubTree"><value>false</value></property> - * <property name="rolePrefix"><value>ROLE_</value></property> - * <property name="convertToUpperCase"><value>true</value></property> + * <property name="searchSubTree" value="false"/> + * <property name="rolePrefix" value="ROLE_"/> + * <property name="convertToUpperCase" value="true"/> * </bean> ** A search for roles for user "uid=ben,ou=people,dc=springframework,dc=org" would return the single granted authority @@ -284,6 +284,10 @@ public class DefaultLdapAuthoritiesPopulator implements LdapAuthoritiesPopulator this.groupSearchFilter = groupSearchFilter; } + /** + * Sets the prefix which will be prepended to the values loaded from the directory. + * Defaults to "ROLE_" for compatibility with RoleVoter/tt>. + */ public void setRolePrefix(String rolePrefix) { Assert.notNull(rolePrefix, "rolePrefix must not be null"); this.rolePrefix = rolePrefix;