Package io.jmix.core.security.impl
Class CurrentUserSubstitutionImpl
java.lang.Object
io.jmix.core.security.impl.CurrentUserSubstitutionImpl
- All Implemented Interfaces:
CurrentUserSubstitution
@Component("sec_CurrentUserSubstitution")
public class CurrentUserSubstitutionImpl
extends Object
implements CurrentUserSubstitution
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentAuthentication
protected CurrentAuthenticationUserLoader
-
Constructor Summary
ConstructorDescriptionCurrentUserSubstitutionImpl
(CurrentAuthentication currentAuthentication, CurrentAuthenticationUserLoader currentAuthenticationUserLoader) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.userdetails.UserDetails
Method returns currently authenticated user (the user who actually logged in).org.springframework.security.core.userdetails.UserDetails
getAuthenticatedUser
(Map<String, Object> hints) Method returns currently authenticated user (the user who actually logged in).org.springframework.security.core.userdetails.UserDetails
Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwiseorg.springframework.security.core.userdetails.UserDetails
getEffectiveUser
(Map<String, Object> hints) Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise.org.springframework.security.core.userdetails.UserDetails
Method returns the substituted user or null if user substitution didn't happen.org.springframework.security.core.userdetails.UserDetails
getSubstitutedUser
(Map<String, Object> hints) Method returns the substituted user or null if user substitution didn't happen.
-
Field Details
-
currentAuthentication
-
currentAuthenticationUserLoader
-
-
Constructor Details
-
CurrentUserSubstitutionImpl
@Autowired public CurrentUserSubstitutionImpl(CurrentAuthentication currentAuthentication, CurrentAuthenticationUserLoader currentAuthenticationUserLoader)
-
-
Method Details
-
getAuthenticatedUser
public org.springframework.security.core.userdetails.UserDetails getAuthenticatedUser()Description copied from interface:CurrentUserSubstitution
Method returns currently authenticated user (the user who actually logged in). The fact of user substitution is not taken into account.- Specified by:
getAuthenticatedUser
in interfaceCurrentUserSubstitution
- Returns:
- currently authenticated user
-
getAuthenticatedUser
public org.springframework.security.core.userdetails.UserDetails getAuthenticatedUser(Map<String, Object> hints) Description copied from interface:CurrentUserSubstitution
Method returns currently authenticated user (the user who actually logged in). The fact of user substitution is not taken into account. See supported hints in theCurrentUserHints
.- Specified by:
getAuthenticatedUser
in interfaceCurrentUserSubstitution
- Parameters:
hints
- hints with user retrieval instructions- Returns:
- currently authenticated user
- See Also:
-
getSubstitutedUser
public org.springframework.security.core.userdetails.UserDetails getSubstitutedUser()Description copied from interface:CurrentUserSubstitution
Method returns the substituted user or null if user substitution didn't happen.- Specified by:
getSubstitutedUser
in interfaceCurrentUserSubstitution
- Returns:
- substituted user or null if user substitution didn't happen
-
getSubstitutedUser
public org.springframework.security.core.userdetails.UserDetails getSubstitutedUser(Map<String, Object> hints) Description copied from interface:CurrentUserSubstitution
Method returns the substituted user or null if user substitution didn't happen. See supported hints in theCurrentUserHints
.- Specified by:
getSubstitutedUser
in interfaceCurrentUserSubstitution
- Parameters:
hints
- hints with user retrieval instructions- Returns:
- substituted user or null if user substitution didn't happen
- See Also:
-
getEffectiveUser
public org.springframework.security.core.userdetails.UserDetails getEffectiveUser()Description copied from interface:CurrentUserSubstitution
Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise- Specified by:
getEffectiveUser
in interfaceCurrentUserSubstitution
- Returns:
- substituted user if the substitution happened or authenticated (logged in) user otherwise
-
getEffectiveUser
public org.springframework.security.core.userdetails.UserDetails getEffectiveUser(Map<String, Object> hints) Description copied from interface:CurrentUserSubstitution
Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise. See supported hints in theCurrentUserHints
.- Specified by:
getEffectiveUser
in interfaceCurrentUserSubstitution
- Parameters:
hints
- hints with user retrieval instructions- Returns:
- substituted user if the substitution happened or authenticated (logged in) user otherwise
- See Also:
-