Class JmixLdapGrantedAuthoritiesMapper

java.lang.Object
io.jmix.ldap.userdetails.JmixLdapGrantedAuthoritiesMapper
All Implemented Interfaces:
org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper

public class JmixLdapGrantedAuthoritiesMapper extends Object implements org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
GrantedAuthoritiesMapper that maps authorities to RoleGrantedAuthoritys.

First, it tries to map provided authorities to Jmix role codes if implementation of LdapAuthorityToJmixRoleCodesMapper is provided. After that, it searches resource and row-level roles with such codes, in case both resource and row-level roles with the same code exist both will be returned.

See Also:
  • Constructor Details

    • JmixLdapGrantedAuthoritiesMapper

      public JmixLdapGrantedAuthoritiesMapper()
  • Method Details

    • setResourceRoleRepository

      @Autowired public void setResourceRoleRepository(ResourceRoleRepository resourceRoleRepository)
    • setRowLevelRoleRepository

      @Autowired public void setRowLevelRoleRepository(RowLevelRoleRepository rowLevelRoleRepository)
    • setLdapAuthorityToJmixRoleCodeMapper

      @Autowired(required=false) public void setLdapAuthorityToJmixRoleCodeMapper(LdapAuthorityToJmixRoleCodesMapper authorityToJmixRoleCodeMapper)
    • setDefaultRoles

      public void setDefaultRoles(List<String> roles)
    • mapAuthorities

      public Set<org.springframework.security.core.GrantedAuthority> mapAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Specified by:
      mapAuthorities in interface org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
    • mapAuthority

      protected List<org.springframework.security.core.GrantedAuthority> mapAuthority(String authority)
    • mapRoleCodesToAuthority

      protected List<org.springframework.security.core.GrantedAuthority> mapRoleCodesToAuthority(Collection<String> roleCodes)