java.lang.Object
eu.rarogsoftware.rarog.platform.api.user.management.StandardUser
All Implemented Interfaces:
RarogUser, Serializable, org.springframework.security.core.CredentialsContainer, org.springframework.security.core.userdetails.UserDetails

public class StandardUser extends Object implements RarogUser
Implementation of RarogUser for users that represent humans. It stores additional data like MFA state and potential more. Use StandardUserBuilder to build instance of this class.
See Also:
  • Constructor Details

    • StandardUser

      protected StandardUser(Long id, String username, String password, Set<org.springframework.security.core.GrantedAuthority> authorities, boolean accountNonExpired, boolean accountNonLocked, boolean credentialsNonExpired, boolean enabled, boolean mfaEnabled)
    • StandardUser

      protected StandardUser(String username, String password, Set<org.springframework.security.core.GrantedAuthority> authorities, boolean accountNonExpired, boolean accountNonLocked, boolean credentialsNonExpired, boolean enabled, boolean mfaEnabled)
    • StandardUser

      public StandardUser(Long id, String username, String password, boolean enabled, boolean mfaEnabled, Set<org.springframework.security.core.GrantedAuthority> authorities)
  • Method Details

    • builder

      public static StandardUserBuilder builder()
    • builderFromCurrent

      public StandardUserBuilder builderFromCurrent()
    • hasAuthority

      public boolean hasAuthority(org.springframework.security.core.GrantedAuthority authority)
    • hasRole

      public boolean hasRole(UserRole role)
    • getId

      public Long getId()
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
    • setPassword

      public void setPassword(String password)
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Specified by:
      isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
    • isAccountNonLocked

      public boolean isAccountNonLocked()
      Specified by:
      isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
    • isCredentialsNonExpired

      public boolean isCredentialsNonExpired()
      Specified by:
      isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.springframework.security.core.userdetails.UserDetails
    • isMfaEnabled

      public Boolean isMfaEnabled()
    • eraseCredentials

      public void eraseCredentials()
      Specified by:
      eraseCredentials in interface org.springframework.security.core.CredentialsContainer
    • isHuman

      public boolean isHuman()
      Specified by:
      isHuman in interface RarogUser
    • isApp

      public boolean isApp()
      Specified by:
      isApp in interface RarogUser
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object