Package io.jmix.restds.auth
Class AbstractRestUserRepository<T extends org.springframework.security.core.userdetails.UserDetails>
java.lang.Object
io.jmix.restds.auth.AbstractRestUserRepository<T>
- Type Parameters:
T- type of entity representing users
- All Implemented Interfaces:
UserRepository,org.springframework.security.core.userdetails.UserDetailsService
public abstract class AbstractRestUserRepository<T extends org.springframework.security.core.userdetails.UserDetails>
extends Object
implements UserRepository
Base implementation of
UserRepository that loads users from the REST DataStore.
The type of entity representing users is specified in the getUserClass() method.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHelps create authorities from roles. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected UnconstrainedDataManagerprotected Metadataprotected ResourceRoleRepositoryprotected RoleGrantedAuthorityUtilsprotected RowLevelRoleRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TCreates the built-in 'anonymous' user.protected Collection<? extends org.springframework.security.core.GrantedAuthority>createAuthorities(RestInvoker restInvoker) protected org.springframework.security.core.GrantedAuthoritycreateAuthority(String role) protected TCreates the built-in 'system' user.org.springframework.security.core.userdetails.UserDetailsReturns the built-in 'anonymous' user.List<? extends org.springframework.security.core.userdetails.UserDetails>getByUsernameLike(String substring) Returns the list of users whose username contains the given substring.protected AbstractRestUserRepository<T>.GrantedAuthoritiesBuilderorg.springframework.security.core.userdetails.UserDetailsReturns the built-in 'system' user.Returns the class of an entity representing users in the application.protected voidinitAnonymousUser(T anonymousUser) Initializes the built-in 'anonymous' user.protected voidinitSystemUser(T systemUser) Initializes the built-in 'system' user.org.springframework.security.core.userdetails.UserDetailsloadUserByUsername(String username)
-
Field Details
-
applicationContext
@Autowired protected org.springframework.context.ApplicationContext applicationContext -
metadata
-
dataManager
-
roleGrantedAuthorityUtils
-
resourceRoleRepository
-
rowLevelRoleRepository
-
-
Constructor Details
-
AbstractRestUserRepository
public AbstractRestUserRepository()
-
-
Method Details
-
getSystemUser
public org.springframework.security.core.userdetails.UserDetails getSystemUser()Description copied from interface:UserRepositoryReturns the built-in 'system' user.- Specified by:
getSystemUserin interfaceUserRepository
-
getAnonymousUser
public org.springframework.security.core.userdetails.UserDetails getAnonymousUser()Description copied from interface:UserRepositoryReturns the built-in 'anonymous' user.- Specified by:
getAnonymousUserin interfaceUserRepository
-
getByUsernameLike
public List<? extends org.springframework.security.core.userdetails.UserDetails> getByUsernameLike(String substring) Description copied from interface:UserRepositoryReturns the list of users whose username contains the given substring.- Specified by:
getByUsernameLikein interfaceUserRepository
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsernamein interfaceorg.springframework.security.core.userdetails.UserDetailsService- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
createAuthorities
protected Collection<? extends org.springframework.security.core.GrantedAuthority> createAuthorities(RestInvoker restInvoker) -
createAuthority
-
getUserClass
Returns the class of an entity representing users in the application. -
createSystemUser
Creates the built-in 'system' user. -
initSystemUser
Initializes the built-in 'system' user. Override in the application to grant authorities or initialize attributes. -
createAnonymousUser
Creates the built-in 'anonymous' user. -
initAnonymousUser
Initializes the built-in 'anonymous' user. Override in the application to grant authorities or initialize attributes. -
getGrantedAuthoritiesBuilder
-