Class OpencastLdapAuthoritiesPopulator
java.lang.Object
org.opencastproject.userdirectory.ldap.OpencastLdapAuthoritiesPopulator
- All Implemented Interfaces:
org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
public class OpencastLdapAuthoritiesPopulator
extends Object
implements org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
Map a series of LDAP attributes to user authorities in Opencast
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpencastLdapAuthoritiesPopulator(String attributeNames, String prefix, String[] aExcludedPrefixes, String groupCheckPrefix, boolean applyAttributesAsRoles, boolean applyAttributesAsGroups, Map<String, String[]> ldapAssignmentRoleMap, Map<String, String[]> ldapAssignmentGroupMap, boolean uppercase, Organization organization, SecurityService securityService, JpaGroupRoleProvider groupRoleProvider, String... additionalAuthorities) Activate component -
Method Summary
Modifier and TypeMethodDescriptionString[]Get the extra roles to be added to any user returned by this authorities populatorReturn the attributes names this object will search forbooleanGet the property that defines whether or not the role names should be converted to uppercase.String[]Get the exclude prefixes being used by this object.Collection<? extends org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(org.springframework.ldap.core.DirContextOperations userData, String username) Get the role prefix being used by this object.voidsetOrgDirectory(JpaGroupRoleProvider groupRoleProvider) OSGi callback for setting the role group service.voidsetSecurityService(SecurityService securityService) OSGi callback for setting the security service.
-
Field Details
-
ROLE_CLEAN_REGEXP
- See Also:
-
ROLE_CLEAN_REPLACEMENT
- See Also:
-
-
Constructor Details
-
OpencastLdapAuthoritiesPopulator
public OpencastLdapAuthoritiesPopulator(String attributeNames, String prefix, String[] aExcludedPrefixes, String groupCheckPrefix, boolean applyAttributesAsRoles, boolean applyAttributesAsGroups, Map<String, String[]> ldapAssignmentRoleMap, Map<String, String[]> ldapAssignmentGroupMap, boolean uppercase, Organization organization, SecurityService securityService, JpaGroupRoleProvider groupRoleProvider, String... additionalAuthorities) Activate component- Parameters:
applyAttributesAsRoles- Specifies, whether the ldap attributes should be added as a role.applyAttributesAsGroups- Specifies, whether the ldap attributes should be added as a group. applyAttributesAsRoles needs to be enabled.ldapAssignmentRoleMap- Maps the ldap assignments to additional roles. Key and value are expected to be uppercase if the bool uppercase is set.ldapAssignmentGroupMap- Maps the ldap assignments to additional groups. Key and value are expected to be uppercase if the bool uppercase is set.
-
-
Method Details
-
getGrantedAuthorities
public Collection<? extends org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(org.springframework.ldap.core.DirContextOperations userData, String username) - Specified by:
getGrantedAuthoritiesin interfaceorg.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
-
getAttributeNames
Return the attributes names this object will search for- Returns:
- a
Collectioncontaining such attribute names
-
getRolePrefix
Get the role prefix being used by this object. Please note that such prefix can be empty.- Returns:
- the role prefix in use.
-
getExcludePrefixes
Get the exclude prefixes being used by this object.- Returns:
- the role prefix in use.
-
getConvertToUpperCase
public boolean getConvertToUpperCase()Get the property that defines whether or not the role names should be converted to uppercase.- Returns:
trueif this class converts the role names to uppercase.falseotherwise.
-
getAdditionalAuthorities
Get the extra roles to be added to any user returned by this authorities populator- Returns:
- A
CollectionofStrings representing the additional roles
-
setOrgDirectory
OSGi callback for setting the role group service. -
setSecurityService
OSGi callback for setting the security service.
-