Class UserAccount

  • All Implemented Interfaces:
    IEntity, Auditable, Serializable, org.apache.cayenne.DataObject, org.apache.cayenne.Persistent, org.apache.cayenne.Validating

    public class UserAccount
    extends _UserAccount
    implements Auditable
    Provides a user account used by SmartForm Manager. User accounts can be managed by SmartForm Manager, or an LDAP directory may be used. User access rights can be controlled by using roles, and users can be authorized to access only a subset of the available portals.
    See Also:
    Serialized Form
    • Field Detail

      • FULL_NAME_PROPERTY

        public static final String FULL_NAME_PROPERTY
        An auxiliary property returning the user's full name
        See Also:
        Constant Field Values
      • ADMINISTRATOR_FLAG_PROPERTY

        public static final String ADMINISTRATOR_FLAG_PROPERTY
        An auxiliary property returning the user's administrator status
        See Also:
        Constant Field Values
      • ACCOUNT_STATUS_ACTIVE

        public static final String ACCOUNT_STATUS_ACTIVE
        Indicates that the user can log on normally
        See Also:
        Constant Field Values
      • ACCOUNT_STATUS_INACTIVE

        public static final String ACCOUNT_STATUS_INACTIVE
        Indicates that the user has been deactivated and cannot log on
        See Also:
        Constant Field Values
      • ACCOUNT_STATUS_LOCKED

        public static final String ACCOUNT_STATUS_LOCKED
        Indicates that the user has been locked permanently after failed login attempts and cannot log on
        See Also:
        Constant Field Values
      • ACCOUNT_STATUS_LOCKED_TEMPORARILY

        public static final String ACCOUNT_STATUS_LOCKED_TEMPORARILY
        Indicates that the user has been locked after failed login attempts and cannot log on until the lockout duration passes
        See Also:
        Constant Field Values
      • ACCOUNT_STATUS_PENDING

        public static final String ACCOUNT_STATUS_PENDING
        Indicates that a user requesting a new account is waiting for approval
        See Also:
        Constant Field Values
      • ACCOUNT_STATUS_REJECTED

        public static final String ACCOUNT_STATUS_REJECTED
        Indicates that a user requesting a new account has been rejected and cannot log on
        See Also:
        Constant Field Values
      • USER_TYPE_LOCAL

        public static final String USER_TYPE_LOCAL
        A user account whose credentials are stored in the TM database
        See Also:
        Constant Field Values
      • USER_TYPE_LDAP

        public static final String USER_TYPE_LDAP
        A user account whose credentials are stored in an external LDAP directory
        See Also:
        Constant Field Values
      • USER_TYPE_SSO

        public static final String USER_TYPE_SSO
        A user account whose credentials are stored in an external idenTity management system.
        See Also:
        Constant Field Values
      • ACCOUNT_STATUSES

        public static final String[] ACCOUNT_STATUSES
        The set of account status values
      • USER_TYPES

        public static final String[] USER_TYPES
        The set of user types
      • PASSWORD_CLEAR_MAX_LENGTH

        public static final int PASSWORD_CLEAR_MAX_LENGTH
        The maximum length for user-entered clear text passwords
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserAccount

        public UserAccount()
    • Method Detail

      • isAdministrator

        public boolean isAdministrator()
        Return whether the user is an administrator (i.e. associated with the Admin Console portal).
        Returns:
        true if the user is an administrator
      • hasRole

        public boolean hasRole​(String roleName)
        Return whether the user has a specific role
        Parameters:
        roleName - the non-null role name to test for
        Returns:
        true if one of the roles the user belongs to has the same name
      • getReceivePromotionAlerts

        public boolean getReceivePromotionAlerts()
        Return whether the user is a member of the pre-defined group Group.RECEIVE_PROMOTION_ALERTS
        Returns:
        true if the user is a member of the group
      • getReceiveAlertsFlag

        public boolean getReceiveAlertsFlag()
        Return whether the user is a member of the pre-defined group Group.RECEIVE_DELIVERY_ESCALATION_ALERTS
        Returns:
        true if the user is a member of the group
      • getReceiveSubmissionUpdates

        public boolean getReceiveSubmissionUpdates()
        Return whether the user is a member of the pre-defined group Group.RECEIVE_SUBMISSION_UPDATES
        Returns:
        true if the user is a member of the group
      • setClearTextPassword

        public void setClearTextPassword​(String value)
        Change the password to the given value. No validation is performed on the password.
        Parameters:
        value - the new password value
      • isActive

        public boolean isActive()
        Return whether the user account is active Note: Even when the user is active, they may not be able to log in if the email verification flag is set.
        Returns:
        true if the account status is ACCOUNT_STATUS_ACTIVE
      • isLocked

        public boolean isLocked()
        Return whether the user account has been locked due to failed login attempts
        Returns:
        true if the account status is ACCOUNT_STATUS_LOCKED
      • isPending

        public boolean isPending()
        Return whether the user account is waiting for approval and activation
        Returns:
        true if the account status is ACCOUNT_STATUS_PENDING
      • isRejected

        public boolean isRejected()
        Return whether the user account has been rejected
        Returns:
        true if the account status is ACCOUNT_STATUS_REJECTED
      • isInactive

        public boolean isInactive()
        Return whether the user account has been deactivated
        Returns:
        true if the account status is ACCOUNT_STATUS_INACTIVE
      • isAssociatedWithPortal

        public boolean isAssociatedWithPortal​(Portal portal)
        Check if the user is associated with the given portal.
        Parameters:
        portal - the portal name
        Returns:
        true if the user have access right to the portal
      • isAssociatedWithPortal

        public boolean isAssociatedWithPortal​(Long portalId)
        Check if the user is associated with the given portal.
        Parameters:
        portalId - the portal id
        Returns:
        true if the user have access right to the portal
        Since:
        3.7.0
      • isAssociatedWithClient

        public boolean isAssociatedWithClient​(Client client)
        Return whether the user account is explicitly associated with the specified client (global access is not taken into account).
        Parameters:
        client - the client (required)
        Returns:
        true if the account status is associated with the specified client
        Since:
        4.1.13
      • getActiveProfile

        public UserProfile getActiveProfile()
        Return the currently active UserProfile for this user
        Returns:
        the active user profile, or null if none was found
      • getUserProfilesOrdered

        public List<UserProfile> getUserProfilesOrdered()
        Return the user profiles ordered by profile name with the active profile at the top.
        Returns:
        the list of user profiles
      • isLocalUser

        public boolean isLocalUser()
        Return whether this user's credentials are stored and managed by SmartForm Manager
        Returns:
        true if the user type is USER_TYPE_LOCAL
      • isLdapUser

        public boolean isLdapUser()
        Return whether this user's credentials are stored and managed by an LDAP directory
        Returns:
        true if the user type is USER_TYPE_LDAP
      • isSsoUser

        public boolean isSsoUser()
        Return whether this user's credentials are stored and managed by an LDAP directory
        Returns:
        true if the user type is USER_TYPE_SSO
      • getGroupNames

        public Set<String> getGroupNames()
        Return the set of group names the user belongs to.
        Returns:
        the set of group names the user belongs to.
      • getFormGroupNames

        public Set<String> getFormGroupNames()
        Return the set of form group names the user belongs to.
        Returns:
        the set of form group names the user belongs to.
        Since:
        4.3.4
      • getJobGroupNames

        public Set<String> getJobGroupNames()
        Return the set of job group names the user belongs to.
        Returns:
        the set of job group names the user belongs to.
        Since:
        17.10.0
      • equals

        public boolean equals​(UserAccount account)
        Return if the user account equals the supplied user account.
        Parameters:
        account - the user account to compare
        Returns:
        boolean.
        Since:
        21.11.0