Package io.jmix.ldap.userdetails
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
RoleGrantedAuthority
s.
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionSet<org.springframework.security.core.GrantedAuthority>
mapAuthorities
(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) protected List<org.springframework.security.core.GrantedAuthority>
mapAuthority
(String authority) protected List<org.springframework.security.core.GrantedAuthority>
mapRoleCodesToAuthority
(Collection<String> roleCodes) void
setDefaultRoles
(List<String> roles) void
setLdapAuthorityToJmixRoleCodeMapper
(LdapAuthorityToJmixRoleCodesMapper authorityToJmixRoleCodeMapper) void
setResourceRoleRepository
(ResourceRoleRepository resourceRoleRepository) void
setRowLevelRoleRepository
(RowLevelRoleRepository rowLevelRoleRepository)
-
Constructor Details
-
JmixLdapGrantedAuthoritiesMapper
public JmixLdapGrantedAuthoritiesMapper()
-
-
Method Details
-
setResourceRoleRepository
-
setRowLevelRoleRepository
-
setLdapAuthorityToJmixRoleCodeMapper
@Autowired(required=false) public void setLdapAuthorityToJmixRoleCodeMapper(LdapAuthorityToJmixRoleCodesMapper authorityToJmixRoleCodeMapper) -
setDefaultRoles
-
mapAuthorities
public Set<org.springframework.security.core.GrantedAuthority> mapAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) - Specified by:
mapAuthorities
in interfaceorg.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
-
mapAuthority
-
mapRoleCodesToAuthority
protected List<org.springframework.security.core.GrantedAuthority> mapRoleCodesToAuthority(Collection<String> roleCodes)
-