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 Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.security.authentication.AuthenticationManagerprotected CurrentAuthenticationprotected org.springframework.context.ApplicationEventPublisherprotected TimeSourceprotected UserRepositoryprotected Collection<UserSubstitutionProvider> -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
UserSubstitutionManagerImpl
public UserSubstitutionManagerImpl()
-
-
Method Details
-
getCurrentSubstitutedUsers
- Specified by:
getCurrentSubstitutedUsersin interfaceUserSubstitutionManager- Returns:
- users which can be substituted by the currently authenticated user at the current time
-
getSubstitutedUsers
public List<org.springframework.security.core.userdetails.UserDetails> getSubstitutedUsers(String username, Date date) - Specified by:
getSubstitutedUsersin interfaceUserSubstitutionManager- Returns:
- users which can be substituted by user with specified
usernameat the givendate
-
getUserSubstitutions
-
substituteUser
CheckUserSubstitutioncollection and performs user substitution- Specified by:
substituteUserin interfaceUserSubstitutionManager- Throws:
IllegalArgumentException- if current user isn't allowed to substitute user with specified name
-
canSubstitute
-