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
Modifier and TypeClassDescriptionclass
Helps create authorities from roles. -
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected UnconstrainedDataManager
protected Metadata
protected ResourceRoleRepository
protected RoleGrantedAuthorityUtils
protected RowLevelRoleRepository
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected T
Creates the built-in 'anonymous' user.protected Collection<? extends org.springframework.security.core.GrantedAuthority>
createAuthorities
(RestInvoker restInvoker) protected org.springframework.security.core.GrantedAuthority
createAuthority
(String role) protected T
Creates the built-in 'system' user.org.springframework.security.core.userdetails.UserDetails
Returns 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>.GrantedAuthoritiesBuilder
org.springframework.security.core.userdetails.UserDetails
Returns the built-in 'system' user.Returns the class of an entity representing users in the application.protected void
initAnonymousUser
(T anonymousUser) Initializes the built-in 'anonymous' user.protected void
initSystemUser
(T systemUser) Initializes the built-in 'system' user.org.springframework.security.core.userdetails.UserDetails
loadUserByUsername
(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:UserRepository
Returns the built-in 'system' user.- Specified by:
getSystemUser
in interfaceUserRepository
-
getAnonymousUser
public org.springframework.security.core.userdetails.UserDetails getAnonymousUser()Description copied from interface:UserRepository
Returns the built-in 'anonymous' user.- Specified by:
getAnonymousUser
in interfaceUserRepository
-
getByUsernameLike
public List<? extends org.springframework.security.core.userdetails.UserDetails> getByUsernameLike(String substring) Description copied from interface:UserRepository
Returns the list of users whose username contains the given substring.- Specified by:
getByUsernameLike
in interfaceUserRepository
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsername
in 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
-