Package com.avoka.fc.core.entity
Class UserAccount
- java.lang.Object
-
- org.apache.cayenne.PersistentObject
-
- org.apache.cayenne.BaseDataObject
-
- org.apache.cayenne.CayenneDataObject
-
- com.avoka.core.entity.BaseEntity
-
- com.avoka.fc.core.entity.auto._UserAccount
-
- com.avoka.fc.core.entity.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 Summary
Fields Modifier and Type Field Description static String
ACCOUNT_STATUS_ACTIVE
Indicates that the user can log on normallystatic String
ACCOUNT_STATUS_INACTIVE
Indicates that the user has been deactivated and cannot log onstatic String
ACCOUNT_STATUS_LOCKED
Indicates that the user has been locked permanently after failed login attempts and cannot log onstatic String
ACCOUNT_STATUS_LOCKED_TEMPORARILY
Indicates that the user has been locked after failed login attempts and cannot log on until the lockout duration passesstatic String
ACCOUNT_STATUS_PENDING
Indicates that a user requesting a new account is waiting for approvalstatic String
ACCOUNT_STATUS_REJECTED
Indicates that a user requesting a new account has been rejected and cannot log onstatic String[]
ACCOUNT_STATUSES
The set of account status valuesstatic String
ADMINISTRATOR_FLAG_PROPERTY
An auxiliary property returning the user's administrator statusstatic String
ANONYMOUS_USER
The login name of the anonymous userstatic String
FULL_NAME_PROPERTY
An auxiliary property returning the user's full namestatic int
PASSWORD_CLEAR_MAX_LENGTH
The maximum length for user-entered clear text passwordsstatic String
ROOT_ADMIN
The login name of the root administrator userstatic String
USER_TYPE_LDAP
A user account whose credentials are stored in an external LDAP directorystatic String
USER_TYPE_LOCAL
A user account whose credentials are stored in the TM databasestatic String
USER_TYPE_SSO
A user account whose credentials are stored in an external idenTity management system.static String[]
USER_TYPES
The set of user types-
Fields inherited from class com.avoka.fc.core.entity.auto._UserAccount
ACCOUNT_STATUS, ACCOUNT_STATUS_PROPERTY, AUDIT_LOGS, AUDIT_LOGS_PROPERTY, AUTHENTICATION_DOMAIN, AUTHENTICATION_DOMAIN_PROPERTY, CHANGE_PASSWORD_AFTER_LOGIN_FLAG, CHANGE_PASSWORD_AFTER_LOGIN_FLAG_PROPERTY, CHECKED_OUT_VERSIONS, CHECKED_OUT_VERSIONS_PROPERTY, CLIENT_USERS, CLIENT_USERS_PROPERTY, COMPOSER_IMPORT_ACTIONS, COMPOSER_IMPORT_ACTIONS_PROPERTY, COMPOSER_PACKAGES, COMPOSER_PACKAGES_PROPERTY, CREATED_TIME, CREATED_TIME_PROPERTY, EMAIL, EMAIL_PROPERTY, EMAIL_VERIFICATION_PURGE_TIME, EMAIL_VERIFICATION_PURGE_TIME_PROPERTY, EMAIL_VERIFICATION_REQUIRED, EMAIL_VERIFICATION_REQUIRED_PROPERTY, FAILED_LOGIN_ATTEMPTS, FAILED_LOGIN_ATTEMPTS_PROPERTY, FAMILY_NAME, FAMILY_NAME_PROPERTY, FILE_UPLOADS, FILE_UPLOADS_PROPERTY, GIVEN_NAME, GIVEN_NAME_PROPERTY, GLOBAL_ACCESS_FLAG, GLOBAL_ACCESS_FLAG_PROPERTY, INSTALLED_TPACS, INSTALLED_TPACS_PROPERTY, JOB_COMMENTS, JOB_COMMENTS_PROPERTY, LAST_ACCESSED_TIME, LAST_ACCESSED_TIME_PROPERTY, LOCKOUT_END_TIME, LOCKOUT_END_TIME_PROPERTY, LOGIN_NAME, LOGIN_NAME_PROPERTY, MANAGED_FORMS, MANAGED_FORMS_PROPERTY, MOBILE, MOBILE_PROPERTY, PASSWORD, PASSWORD_PROPERTY, PASSWORD_SALT, PASSWORD_SALT_PROPERTY, PHONE, PHONE_PROPERTY, PORTAL_PREFS, PORTAL_PREFS_PROPERTY, PORTAL_USERS, PORTAL_USERS_PROPERTY, PROMOTION_LOG, PROMOTION_LOG_PROPERTY, REQUEST_LOGS, REQUEST_LOGS_PROPERTY, SUBMISSION_COMMENTS, SUBMISSION_COMMENTS_PROPERTY, SUBMISSION_HISTORY_LIST, SUBMISSION_HISTORY_LIST_PROPERTY, SUBMISSIONS, SUBMISSIONS_PROPERTY, TWO_FACTOR_AUTHENTICATION_KEY, TWO_FACTOR_AUTHENTICATION_KEY_PROPERTY, TWO_FACTOR_AUTHENTICATION_REQUIRED_FLAG, TWO_FACTOR_AUTHENTICATION_REQUIRED_FLAG_PROPERTY, USER_AUTH_EVENTS, USER_AUTH_EVENTS_PROPERTY, USER_GROUPS, USER_GROUPS_PROPERTY, USER_KEY, USER_KEY_PROPERTY, USER_OID_PK_COLUMN, USER_PROFILES, USER_PROFILES_PROPERTY, USER_PROJECTS, USER_PROJECTS_PROPERTY, USER_ROLES, USER_ROLES_PROPERTY, USER_TYPE, USER_TYPE_PROPERTY
-
Fields inherited from class com.avoka.core.entity.BaseEntity
ID_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description UserAccount()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(UserAccount account)
Return if the user account equals the supplied user account.UserProfile
getActiveProfile()
Return the currently activeUserProfile
for this userSet<String>
getFormGroupNames()
Return the set of form group names the user belongs to.String
getFullName()
Return the full name of the userSet<String>
getGroupNames()
Return the set of group names the user belongs to.Set<String>
getJobGroupNames()
Return the set of job group names the user belongs to.boolean
getReceiveAlertsFlag()
Return whether the user is a member of the pre-defined groupGroup.RECEIVE_DELIVERY_ESCALATION_ALERTS
boolean
getReceivePromotionAlerts()
Return whether the user is a member of the pre-defined groupGroup.RECEIVE_PROMOTION_ALERTS
boolean
getReceiveSubmissionUpdates()
Return whether the user is a member of the pre-defined groupGroup.RECEIVE_SUBMISSION_UPDATES
List<UserProfile>
getUserProfilesOrdered()
Return the user profiles ordered by profile name with the active profile at the top.boolean
hasRole(String roleName)
Return whether the user has a specific roleboolean
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.boolean
isAdministrator()
Return whether the user is an administrator (i.e.boolean
isAssociatedWithClient(Client client)
Return whether the user account is explicitly associated with the specified client (global access is not taken into account).boolean
isAssociatedWithPortal(Portal portal)
Check if the user is associated with the given portal.boolean
isAssociatedWithPortal(Long portalId)
Check if the user is associated with the given portal.boolean
isInactive()
Return whether the user account has been deactivatedboolean
isLdapUser()
Return whether this user's credentials are stored and managed by an LDAP directoryboolean
isLocalUser()
Return whether this user's credentials are stored and managed by SmartForm Managerboolean
isLocked()
Return whether the user account has been locked due to failed login attemptsboolean
isLockedTemporarily()
Return whether the user account has been locked temporarily due to failed login attempts The lock will cease to be in effect after_UserAccount.getLockoutEndTime()
boolean
isPending()
Return whether the user account is waiting for approval and activationboolean
isRejected()
Return whether the user account has been rejectedboolean
isSsoUser()
Return whether this user's credentials are stored and managed by an LDAP directoryvoid
setClearTextPassword(String value)
Change the password to the given value.-
Methods inherited from class com.avoka.fc.core.entity.auto._UserAccount
addToAuditLogs, addToCheckedOutVersions, addToClientUsers, addToComposerImportActions, addToComposerPackages, addToFileUploads, addToInstalledTPacs, addToJobComments, addToManagedForms, addToPortalPrefs, addToPortalUsers, addToPromotionLog, addToRequestLogs, addToSubmissionComments, addToSubmissionHistoryList, addToSubmissions, addToUserAuthEvents, addToUserGroups, addToUserProfiles, addToUserProjects, addToUserRoles, getAccountStatus, getAuditLogs, getAuthenticationDomain, getCheckedOutVersions, getClientUsers, getComposerImportActions, getComposerPackages, getCreatedTime, getEmail, getEmailVerificationPurgeTime, getFailedLoginAttempts, getFamilyName, getFileUploads, getGivenName, getInstalledTPacs, getJobComments, getLastAccessedTime, getLockoutEndTime, getLoginName, getManagedForms, getMobile, getPassword, getPasswordSalt, getPhone, getPortalPrefs, getPortalUsers, getPromotionLog, getRequestLogs, getSubmissionComments, getSubmissionHistoryList, getSubmissions, getTwoFactorAuthenticationKey, getUserAuthEvents, getUserGroups, getUserKey, getUserProfiles, getUserProjects, getUserRoles, getUserType, isChangePasswordAfterLoginFlag, isEmailVerificationRequired, isGlobalAccessFlag, isTwoFactorAuthenticationRequiredFlag, removeFromAuditLogs, removeFromCheckedOutVersions, removeFromClientUsers, removeFromComposerImportActions, removeFromComposerPackages, removeFromFileUploads, removeFromInstalledTPacs, removeFromJobComments, removeFromManagedForms, removeFromPortalPrefs, removeFromPortalUsers, removeFromPromotionLog, removeFromRequestLogs, removeFromSubmissionComments, removeFromSubmissionHistoryList, removeFromSubmissions, removeFromUserAuthEvents, removeFromUserGroups, removeFromUserProfiles, removeFromUserProjects, removeFromUserRoles, setAccountStatus, setAuthenticationDomain, setChangePasswordAfterLoginFlag, setCreatedTime, setEmail, setEmailVerificationPurgeTime, setEmailVerificationRequired, setFailedLoginAttempts, setFamilyName, setGivenName, setGlobalAccessFlag, setLastAccessedTime, setLockoutEndTime, setLoginName, setMobile, setPassword, setPasswordSalt, setPhone, setTwoFactorAuthenticationKey, setTwoFactorAuthenticationRequiredFlag, setUserKey, setUserType
-
Methods inherited from class com.avoka.core.entity.BaseEntity
appendProperties, getId, getValuesMap, isNew, setId, toString
-
Methods inherited from class org.apache.cayenne.CayenneDataObject
makePath, readPropertyDirectly, readState, setPersistenceState, writePropertyDirectly, writeState
-
Methods inherited from class org.apache.cayenne.BaseDataObject
addToManyTarget, beforePropertyRead, beforePropertyWrite, getSnapshotVersion, readNestedProperty, readProperty, readSerialized, removeToManyTarget, setObjectContext, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writeSerialized
-
Methods inherited from class org.apache.cayenne.PersistentObject
getMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.avoka.fc.core.entity.Auditable
getId, getValuesMap
-
-
-
-
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
-
ROOT_ADMIN
public static final String ROOT_ADMIN
The login name of the root administrator user- 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
-
ANONYMOUS_USER
public static final String ANONYMOUS_USER
The login name of the anonymous user- See Also:
- Constant Field Values
-
-
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 groupGroup.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 groupGroup.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 groupGroup.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
-
isLockedTemporarily
public boolean isLockedTemporarily()
Return whether the user account has been locked temporarily due to failed login attempts The lock will cease to be in effect after_UserAccount.getLockoutEndTime()
- Returns:
- true if the account status is
ACCOUNT_STATUS_LOCKED_TEMPORARILY
-
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 activeUserProfile
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
-
getFullName
public String getFullName()
Return the full name of the user- Returns:
- a combination of
_UserAccount.getGivenName()
and_UserAccount.getFamilyName()
-
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
-
-