Class AccountUserDetails

  • All Implemented Interfaces:
    Serializable, org.springframework.security.core.userdetails.UserDetails

    public class AccountUserDetails
    extends Object
    implements org.springframework.security.core.userdetails.UserDetails
    Provides an AccountUser UserDetails adaptor.
    See Also:
    UserAccount, UserDetails, Serialized Form
    • Constructor Detail

      • AccountUserDetails

        public AccountUserDetails​(UserAccount userAccount,
                                  Collection<org.springframework.security.core.GrantedAuthority> authorities)
        Create a new UserDetailsAdaptor object based on the given user account.
        Parameters:
        userAccount - a valid system user account (required)
        authorities - the granted user authorities or groups the user belongs to
        Since:
        3.6.0
      • AccountUserDetails

        public AccountUserDetails​(UserAccount userAccount)
        Create a new UserDetailsAdaptor object based on the given user account.
        Parameters:
        userAccount - a valid system user account (required)
        Since:
        3.6.0
      • AccountUserDetails

        public AccountUserDetails​(UserAccount userAccount,
                                  Set<String> groupNames)
        Create a new UserDetailsAdaptor object based on the given user account and groups (granted authorities).
        Parameters:
        userAccount - a valid system user account
        groupNames - the names of the groups (granted authorities)
    • Method Detail

      • getAuthorities

        public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
        Return the list of authorities associated with the user
        Specified by:
        getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        an array containing GrantedAuthorityAdaptor objects representing SmartForm Manager roles
        See Also:
        UserDetails.getAuthorities()
      • getPassword

        public String getPassword()
        Return the password.
        Specified by:
        getPassword in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        the password
        See Also:
        UserDetails.getPassword()
      • getPasswordSalt

        public String getPasswordSalt()
        Return the password salt if defined.
        Returns:
        the password salt
        See Also:
        AccountSaltSource
      • getUsername

        public String getUsername()
        Return the user login name or principal.
        Specified by:
        getUsername in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        the user login name or principal
        See Also:
        UserDetails.getUsername()
      • isAccountNonExpired

        public boolean isAccountNonExpired()
        Return whether the account has not yet expired (currently always returns true).
        Specified by:
        isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        true if the account has not yet expired
        See Also:
        UserDetails.isAccountNonExpired()
      • isAccountNonLocked

        public boolean isAccountNonLocked()
        Return whether the account has not been locked.
        Specified by:
        isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        true if the account has not been locked
        See Also:
        UserDetails.isAccountNonLocked()
      • isCredentialsNonExpired

        public boolean isCredentialsNonExpired()
        Return whether the account credentials have not yet expired (currently always returns true)
        Specified by:
        isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        true if the account credentials have not yet expired
        See Also:
        UserDetails.isCredentialsNonExpired()
      • isEnabled

        public boolean isEnabled()
        Return whether the account is enabled.
        Specified by:
        isEnabled in interface org.springframework.security.core.userdetails.UserDetails
        Returns:
        true if the SmartForm Manager account is active
        See Also:
        UserDetails.isEnabled()
      • getUserAccount

        public UserAccount getUserAccount()
        Return the underlying user account.
        Returns:
        the underlying user account