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

public class SystemUserWrapper extends UserWrapper implements Serializable
A SystemUserWrapper.
Author:
Heiko Scherrer
See Also:
  • Field Details

    • password

      private String password
  • Constructor Details

    • SystemUserWrapper

      public SystemUserWrapper(User user)
      Create a new SystemUserWrapper.
      Parameters:
      user - The wrapped user
  • Method Details

    • getPassword

      public String getPassword()
      Get the password.
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
      Overrides:
      getPassword in class UserWrapper
      Returns:
      this password or the password, set in the superclass
    • setPassword

      public void setPassword(String password)
      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 class UserWrapper
      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 class UserWrapper
    • equals

      public boolean equals(Object obj)

      Uses authorities and user for comparison.

      Use password field for comparison.

      Overrides:
      equals in class UserWrapper