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
Modifier and TypeFieldDescriptionprotected org.springframework.security.authentication.AuthenticationManager
protected CurrentAuthentication
protected org.springframework.context.ApplicationEventPublisher
protected TimeSource
protected UserRepository
protected Collection<UserSubstitutionProvider>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canSubstitute
(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) void
substituteUser
(String substitutedUserName) CheckUserSubstitution
collection 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:
getCurrentSubstitutedUsers
in 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:
getSubstitutedUsers
in interfaceUserSubstitutionManager
- Returns:
- users which can be substituted by user with specified
username
at the givendate
-
getUserSubstitutions
-
substituteUser
CheckUserSubstitution
collection and performs user substitution- Specified by:
substituteUser
in interfaceUserSubstitutionManager
- Throws:
IllegalArgumentException
- if current user isn't allowed to substitute user with specified name
-
canSubstitute
-