@Component(value="core_UserSubstitutionManager") public class UserSubstitutionManagerImpl extends java.lang.Object implements UserSubstitutionManager
Modifier and Type | Field and Description |
---|---|
protected org.springframework.security.authentication.AuthenticationManager |
authenticationManager |
protected CurrentAuthentication |
currentAuthentication |
protected org.springframework.context.ApplicationEventPublisher |
eventPublisher |
protected TimeSource |
timeSource |
protected UserRepository |
userRepository |
protected java.util.Collection<UserSubstitutionProvider> |
userSubstitutionProviders |
Constructor and Description |
---|
UserSubstitutionManagerImpl() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canSubstitute(java.lang.String userName,
java.lang.String substitutedUserName) |
java.util.List<org.springframework.security.core.userdetails.UserDetails> |
getCurrentSubstitutedUsers() |
java.util.List<org.springframework.security.core.userdetails.UserDetails> |
getSubstitutedUsers(java.lang.String username,
java.util.Date date) |
protected java.util.Collection<UserSubstitution> |
getUserSubstitutions(java.lang.String username,
java.util.Date date) |
void |
substituteUser(java.lang.String substitutedUserName)
Check
UserSubstitution collection and performs user substitution |
@Autowired(required=false) protected UserRepository userRepository
@Autowired protected CurrentAuthentication currentAuthentication
@Autowired(required=false) protected org.springframework.security.authentication.AuthenticationManager authenticationManager
@Autowired protected org.springframework.context.ApplicationEventPublisher eventPublisher
@Autowired protected java.util.Collection<UserSubstitutionProvider> userSubstitutionProviders
@Autowired protected TimeSource timeSource
public java.util.List<org.springframework.security.core.userdetails.UserDetails> getCurrentSubstitutedUsers()
getCurrentSubstitutedUsers
in interface UserSubstitutionManager
public java.util.List<org.springframework.security.core.userdetails.UserDetails> getSubstitutedUsers(java.lang.String username, java.util.Date date)
getSubstitutedUsers
in interface UserSubstitutionManager
username
at the given date
protected java.util.Collection<UserSubstitution> getUserSubstitutions(java.lang.String username, java.util.Date date)
public void substituteUser(java.lang.String substitutedUserName)
UserSubstitution
collection and performs user substitutionsubstituteUser
in interface UserSubstitutionManager
java.lang.IllegalArgumentException
- if current user isn't allowed to substitute user with specified nameprotected boolean canSubstitute(java.lang.String userName, java.lang.String substitutedUserName)