Package io.jmix.oidc.claimsmapper
Class BaseClaimsRolesMapper
java.lang.Object
io.jmix.oidc.claimsmapper.BaseClaimsRolesMapper
- All Implemented Interfaces:
- ClaimsRolesMapper
- Direct Known Subclasses:
- DefaultClaimsRolesMapper
ClaimsRolesMapper that can be used as super-class for your own ClaimsRolesMapper implementations. The
 child classes must override the getResourceRolesCodes(Map) or/and getRowLevelRoleCodes(Map)
 methods. The behavior for finding roles with given codes and transforming them into a collection of GrantedAuthority is already implemented in the current class.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ResourceRoleRepositoryprotected RoleGrantedAuthorityUtilsprotected RowLevelRoleRepository
- 
Constructor SummaryConstructorsConstructorDescriptionBaseClaimsRolesMapper(ResourceRoleRepository resourceRoleRepository, RowLevelRoleRepository rowLevelRoleRepository, RoleGrantedAuthorityUtils roleGrantedAuthorityUtils) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected Collection<String>getResourceRolesCodes(Map<String, Object> claims) protected Collection<String>getRowLevelRoleCodes(Map<String, Object> claims) Collection<? extends org.springframework.security.core.GrantedAuthority>toGrantedAuthorities(Map<String, Object> claims) Transforms collection of roles returned bytoResourceRoles(Map)andtoRowLevelRoles(Map)into a collection ofGrantedAuthority.toResourceRoles(Map<String, Object> claims) toRowLevelRoles(Map<String, Object> claims) 
- 
Field Details- 
rowLevelRoleRepository
- 
resourceRoleRepository
- 
roleGrantedAuthorityUtils
 
- 
- 
Constructor Details- 
BaseClaimsRolesMapperpublic BaseClaimsRolesMapper(ResourceRoleRepository resourceRoleRepository, RowLevelRoleRepository rowLevelRoleRepository, RoleGrantedAuthorityUtils roleGrantedAuthorityUtils) 
 
- 
- 
Method Details- 
toResourceRoles- Specified by:
- toResourceRolesin interface- ClaimsRolesMapper
 
- 
toRowLevelRoles- Specified by:
- toRowLevelRolesin interface- ClaimsRolesMapper
 
- 
getResourceRolesCodes
- 
getRowLevelRoleCodes
- 
toGrantedAuthoritiespublic Collection<? extends org.springframework.security.core.GrantedAuthority> toGrantedAuthorities(Map<String, Object> claims) Transforms collection of roles returned bytoResourceRoles(Map)andtoRowLevelRoles(Map)into a collection ofGrantedAuthority.- Specified by:
- toGrantedAuthoritiesin interface- ClaimsRolesMapper
- Parameters:
- claims- pieces of information about the user returned by the OpenID Provider
- Returns:
- a collection of granted authorities that contain information about resource and row-level roles available to the user
 
 
-