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 Details

  • 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:
      getGrantedAuthorities in interface org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
    • getAttributeNames

      public Collection<String> getAttributeNames()
      Return the attributes names this object will search for
      Returns:
      a Collection containing such attribute names
    • getRolePrefix

      public String 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

      public String[] 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:
      true if this class converts the role names to uppercase. false otherwise.
    • getAdditionalAuthorities

      public String[] getAdditionalAuthorities()
      Get the extra roles to be added to any user returned by this authorities populator
      Returns:
      A Collection of Strings representing the additional roles
    • setOrgDirectory

      public void setOrgDirectory(JpaGroupRoleProvider groupRoleProvider)
      OSGi callback for setting the role group service.
    • setSecurityService

      public void setSecurityService(SecurityService securityService)
      OSGi callback for setting the security service.