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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDefaultGrants
(Collection<org.springframework.security.core.GrantedAuthority> authorities) Subclasses can set a collection of grants that are always available for an User.boolean
Get the password.int
hashCode()
void
setPassword
(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:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Overrides:
getPassword
in 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_NAME
to the collection of authorities.- Overrides:
addDefaultGrants
in 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:
hashCode
in classUserWrapper
-
equals
Uses authorities and user for comparison.
Use password field for comparison.
- Overrides:
equals
in classUserWrapper
-