Package org.openwms.core.uaa.impl
Class SystemUserWrapper
java.lang.Object
org.openwms.core.uaa.impl.UserWrapper
org.openwms.core.uaa.impl.SystemUserWrapper
- All Implemented Interfaces:
Serializable,UserHolder,org.springframework.security.core.userdetails.UserDetails
A SystemUserWrapper.
- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDefaultGrants(Collection<org.springframework.security.core.GrantedAuthority> authorities) Subclasses can set a collection of grants that are always available for an User.booleanGet the password.inthashCode()voidsetPassword(String password) Set the password.Methods inherited from class org.openwms.core.uaa.impl.UserWrapper
getAuthorities, getUser, getUsername, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled, toString
-
Field Details
-
password
-
-
Constructor Details
-
SystemUserWrapper
Create a new SystemUserWrapper.- Parameters:
user- The wrapped user
-
-
Method Details
-
getPassword
Get the password.- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails- Overrides:
getPasswordin classUserWrapper- Returns:
- this password or the password, set in the superclass
-
setPassword
Set the password.- Parameters:
password- The password to set.
-
addDefaultGrants
protected void addDefaultGrants(Collection<org.springframework.security.core.GrantedAuthority> authorities) Subclasses can set a collection of grants that are always available for an User. This is useful for administrative accounts.For the SystemUser account always add the
SystemUser.SYSTEM_ROLE_NAMEto the collection of authorities.- Overrides:
addDefaultGrantsin classUserWrapper- Parameters:
authorities- A collection of grants (authorities) where the default grants are added to
-
hashCode
public int hashCode()Uses authorities and user for calculation.
Use password field in addition to inherited fields.
- Overrides:
hashCodein classUserWrapper
-
equals
Uses authorities and user for comparison.
Use password field for comparison.
- Overrides:
equalsin classUserWrapper
-