Class UserSubstitutionManagerImpl
java.lang.Object
io.jmix.core.usersubstitution.impl.UserSubstitutionManagerImpl
- All Implemented Interfaces:
- UserSubstitutionManager
@Component("core_UserSubstitutionManager")
public class UserSubstitutionManagerImpl
extends Object
implements UserSubstitutionManager
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected org.springframework.security.authentication.AuthenticationManagerprotected CurrentAuthenticationprotected org.springframework.context.ApplicationEventPublisherprotected TimeSourceprotected UserRepositoryprotected Collection<UserSubstitutionProvider>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleancanSubstitute(String userName, String substitutedUserName) List<org.springframework.security.core.userdetails.UserDetails>List<org.springframework.security.core.userdetails.UserDetails>getSubstitutedUsers(String username, Date date) protected Collection<UserSubstitution>getUserSubstitutions(String username, Date date) voidsubstituteUser(String substitutedUserName) CheckUserSubstitutioncollection and performs user substitution
- 
Field Details- 
userRepository
- 
currentAuthentication
- 
authenticationManager@Autowired(required=false) protected org.springframework.security.authentication.AuthenticationManager authenticationManager
- 
eventPublisher@Autowired protected org.springframework.context.ApplicationEventPublisher eventPublisher
- 
userSubstitutionProviders
- 
timeSource
 
- 
- 
Constructor Details- 
UserSubstitutionManagerImplpublic UserSubstitutionManagerImpl()
 
- 
- 
Method Details- 
getCurrentSubstitutedUsers- Specified by:
- getCurrentSubstitutedUsersin interface- UserSubstitutionManager
- Returns:
- users which can be substituted by the currently authenticated user at the current time
 
- 
getSubstitutedUserspublic List<org.springframework.security.core.userdetails.UserDetails> getSubstitutedUsers(String username, Date date) - Specified by:
- getSubstitutedUsersin interface- UserSubstitutionManager
- Returns:
- users which can be substituted by user with specified usernameat the givendate
 
- 
getUserSubstitutions
- 
substituteUserCheckUserSubstitutioncollection and performs user substitution- Specified by:
- substituteUserin interface- UserSubstitutionManager
- Throws:
- IllegalArgumentException- if current user isn't allowed to substitute user with specified name
 
- 
canSubstitute
 
-