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
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:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Indicates that the user can log on normallystatic final String
Indicates that the user has been deactivated and cannot log onstatic final String
Indicates that the user has been locked permanently after failed login attempts and cannot log onstatic final String
Indicates that the user has been locked after failed login attempts and cannot log on until the lockout duration passesstatic final String
Indicates that a user requesting a new account is waiting for approvalstatic final String
Indicates that a user requesting a new account has been rejected and cannot log onstatic final String[]
The set of account status valuesstatic final String
An auxiliary property returning the user's administrator statusstatic final String
The login name of the anonymous userstatic final String
An auxiliary property returning the user's full namestatic final int
The maximum length for user-entered clear text passwordsstatic final String
The login name of the root administrator userstatic final String
A user account whose credentials are stored in an external LDAP directorystatic final String
A user account whose credentials are stored in the TM databasestatic final String
A user account whose credentials are stored in an external idenTity management system.static final String[]
The set of user typesFields 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
Fields inherited from class org.apache.cayenne.CayenneDataObject
values
Fields inherited from class org.apache.cayenne.BaseDataObject
snapshotVersion
Fields inherited from class org.apache.cayenne.PersistentObject
objectContext, objectId, persistenceState
Fields inherited from interface org.apache.cayenne.DataObject
DEFAULT_VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(UserAccount account) Return if the user account equals the supplied user account.Return the currently activeUserProfile
for this userReturn the set of form group names the user belongs to.Return the full name of the userReturn the set of group names the user belongs to.Return the set of job group names the user belongs to.boolean
Return whether the user is a member of the pre-defined groupGroup.RECEIVE_DELIVERY_ESCALATION_ALERTS
boolean
Return whether the user is a member of the pre-defined groupGroup.RECEIVE_PROMOTION_ALERTS
boolean
Return whether the user is a member of the pre-defined groupGroup.RECEIVE_SUBMISSION_UPDATES
Return the user profiles ordered by profile name with the active profile at the top.boolean
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
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
Return whether the user account has been deactivatedboolean
Return whether this user's credentials are stored and managed by an LDAP directoryboolean
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
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
Return whether the user account is waiting for approval and activationboolean
Return whether the user account has been rejectedboolean
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
Methods inherited from interface org.apache.cayenne.Persistent
getObjectContext, getObjectId, getPersistenceState, setObjectContext, setObjectId, setPersistenceState
-
Field Details
-
FULL_NAME_PROPERTY
An auxiliary property returning the user's full name- See Also:
-
ADMINISTRATOR_FLAG_PROPERTY
An auxiliary property returning the user's administrator status- See Also:
-
ROOT_ADMIN
The login name of the root administrator user- See Also:
-
ACCOUNT_STATUS_ACTIVE
Indicates that the user can log on normally- See Also:
-
ACCOUNT_STATUS_INACTIVE
Indicates that the user has been deactivated and cannot log on- See Also:
-
ACCOUNT_STATUS_LOCKED
Indicates that the user has been locked permanently after failed login attempts and cannot log on- See Also:
-
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:
-
ACCOUNT_STATUS_PENDING
Indicates that a user requesting a new account is waiting for approval- See Also:
-
ACCOUNT_STATUS_REJECTED
Indicates that a user requesting a new account has been rejected and cannot log on- See Also:
-
USER_TYPE_LOCAL
A user account whose credentials are stored in the TM database- See Also:
-
USER_TYPE_LDAP
A user account whose credentials are stored in an external LDAP directory- See Also:
-
USER_TYPE_SSO
A user account whose credentials are stored in an external idenTity management system.- See Also:
-
ACCOUNT_STATUSES
The set of account status values -
USER_TYPES
The set of user types -
PASSWORD_CLEAR_MAX_LENGTH
public static final int PASSWORD_CLEAR_MAX_LENGTHThe maximum length for user-entered clear text passwords- See Also:
-
ANONYMOUS_USER
The login name of the anonymous user- See Also:
-
-
Constructor Details
-
UserAccount
public UserAccount()
-
-
Method Details
-
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
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
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
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
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
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
Return the currently activeUserProfile
for this user- Returns:
- the active user profile, or null if none was found
-
getUserProfilesOrdered
Return the user profiles ordered by profile name with the active profile at the top.- Returns:
- the list of user profiles
-
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
Return the set of group names the user belongs to.- Returns:
- the set of group names the user belongs to.
-
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
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
Return if the user account equals the supplied user account.- Parameters:
account
- the user account to compare- Returns:
- boolean.
- Since:
- 21.11.0
-