Package com.avoka.fc.core.dao
Class UserAccountDao
java.lang.Object
com.avoka.core.dao.BaseDao
com.avoka.fc.core.dao.AbstractDao
com.avoka.fc.core.dao.UserAccountDao
Provides a DAO for the UserAccount entity.
- See Also:
-
Field Summary
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clear the thread local user account cache.boolean
doesLocalUserAccountExistForLogin
(String loginName) Return true if a Local user type exists for the given login name.getActiveAdminAccountForLogin
(String loginName) Return the active user account with the given login name.getActiveClients
(UserAccount userAccount) Return the list of clients associated with the administrative user, will return empty list for global clients.getActiveUserAccountForLogin
(String loginName) Return the active user account with the given login namegetActiveUserAccountsForClient
(String clientId) Return the list of active user accounts associated with a client, ordered by login nameReturn the list of active user accounts associated with a client and global user accounts, ordered by login namegetActiveUserForLoginAndPortal
(String loginName, Portal portal) Return the active user account for the given login name and portalgetActiveUsersInGroup
(String groupName) Return all active user accounts who are members of a specific group, ordered by login namegetActiveUsersInGroups
(Set<String> groupNameSet) Return all active user accounts who are members of a set of groups, ordered by login namegetActiveUsersInGroupWithClientAccess
(String groupName, Client client) Return all active user accounts who are members of a specific group, ordered by login name.Return the list of active users subscribed to theGroup.RECEIVE_DELIVERY_ESCALATION_ALERTS
group for the specified clientgetAdministratorClients
(String loginName) Return a list of clients the administrator has access to.getAdminsWithPermission
(String clientId, String permissionName) Return all user accounts for the given client, who also have the specified permissiongetPermissionNames
(String userOid, String portalName) Return the set of permissions for a user on a given portalgetPermissionNamesForLogin
(String loginName, String portalName) Return the set of permissions for a user loginName on a given portal portalName.Return a list of user accounts requiring email verification that are ready to purge, sorted ascending by creation date.getUserAccountForEmail
(String emailAddress) Return the user account for the given email address, or null if not foundgetUserAccountForLogin
(String loginName) Return the user account with the given login nameReturn the user account with the specified OIDgetUserAccountForUserKey
(String userKey) Return the user account for the given user surrogate keyReturn all user accounts, including inactive users, ordered by login namegetUserAccountList
(String clientId, String keyword, String portalId, String userType, String accountStatus) Return the list of user accounts matching the specified search criteriagetUserClientIdSet
(UserAccount userAccount) Return the users set of client IDs.getUserForLoginAndPortal
(String loginName, Portal portal) Return the user account for the given login name and portal.getUserSearch
(String clientId, String value) Return a list of users whose given name, family name, login name or email address contain the search string, or whose OID matches the search string if it is numericgetUsersWithLoginNameOrEmail
(String userIdentifier) Return the list of users whose login name or email matches the specified identifierstatic void
Invalidate the user results cache.boolean
isClientAccessibleToUser
(UserAccount userAccount, Client client) Checks if is user accessible to client.boolean
isClientSuperset
(UserAccount userAccount, UserAccount targetUserAccount) Return whether a user is associated with a superset of the clients of another target user.boolean
isSubmissionAccessibleToAdministrator
(Submission submission, UserAccount userAccount) Return true if the submission is accessible to the given administrator user.static String
normalizeLogin
(String loginName) Return the normalized login name.void
setReceiveSubmissionUpdates
(UserAccount userAccount, boolean receive) Add the user to / remove the user from theGroup.RECEIVE_SUBMISSION_UPDATES
groupMethods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
Constructor Details
-
UserAccountDao
public UserAccountDao()
-
-
Method Details
-
clearThreadLocalCache
public static void clearThreadLocalCache()Clear the thread local user account cache.- Since:
- 4.3.2
-
invalidateCache
public static void invalidateCache()Invalidate the user results cache.- Since:
- 4.3.2
-
getUserAccountForPK
Return the user account with the specified OID- Parameters:
id
- the OID- Returns:
- the matching user account, or null if not found
-
getUserAccountForUserKey
Return the user account for the given user surrogate key- Parameters:
userKey
- the user surrogate key- Returns:
- the matching user account
-
getUserAccountForLogin
Return the user account with the given login name- Parameters:
loginName
- the login name- Returns:
- the matching user account
-
getUserAccountForEmail
Return the user account for the given email address, or null if not found- Parameters:
emailAddress
- the user account email address- Returns:
- the user account if found or null otherwise
- Since:
- 4.0.0
-
doesLocalUserAccountExistForLogin
Return true if a Local user type exists for the given login name.- Parameters:
loginName
- the login name- Returns:
- true if a Local user type exists for the given login name
-
getActiveUserAccountForLogin
Return the active user account with the given login name- Parameters:
loginName
- the login name- Returns:
- the matching user account
-
getActiveAdminAccountForLogin
Return the active user account with the given login name. This method is similar togetActiveUserAccountForLogin(String)
but does an additional prefetch on the clientUsers property. No filtering is done on portal associations, so non-admin users will still be found and returned.- Parameters:
loginName
- the login name- Returns:
- the matching user account
- Since:
- 4.0.0
-
getUsersWithLoginNameOrEmail
Return the list of users whose login name or email matches the specified identifier- Parameters:
userIdentifier
- the login name or email address to look for- Returns:
- the list of matching users
-
getActiveUserForLoginAndPortal
Return the active user account for the given login name and portal- Parameters:
loginName
- the login nameportal
- the portal the user is associated with- Returns:
- the matching user account
-
getActiveClients
Return the list of clients associated with the administrative user, will return empty list for global clients.- Parameters:
userAccount
- the administrative user account- Returns:
- the list of clients associated with the administrative user, will return empty list for global clients.
- Since:
- 4.0.0
-
isClientSuperset
Return whether a user is associated with a superset of the clients of another target user. If this is the case, the user may be allowed to view/edit the target user (based on additional conditions); otherwise access must not be granted. Note that if the user is a global administrator, this method returns true.- Parameters:
userAccount
- the user account (required)targetUserAccount
- the target user account (required)- Returns:
- true if userAccount has global access, or the clients associated with userAccount are a superset of the clients associated with targetUserAccount
- Since:
- 4.0.0
-
getUserForLoginAndPortal
Return the user account for the given login name and portal.- Parameters:
loginName
- the login nameportal
- the portal the user is associated with- Returns:
- the matching user account
-
getUserClientIdSet
Return the users set of client IDs.- Parameters:
userAccount
- the user account (required)- Returns:
- the users set of client IDs
- Since:
- 4.3.2
-
getPermissionNames
Return the set of permissions for a user on a given portal- Parameters:
userOid
- the OID of a SmartForm Manager userportalName
- the name o a portal- Returns:
- the set of permission names that are assigned to the user for the given portal
-
getPermissionNamesForLogin
Return the set of permissions for a user loginName on a given portal portalName.- Parameters:
loginName
- the user login nameportalName
- the name o a portal- Returns:
- the set of permission names that are assigned to the user for the given portal
- Since:
- 4.0.0
-
getUserAccountList
Return all user accounts, including inactive users, ordered by login name- Returns:
- the list of user accounts
-
getUserAccountList
public List<UserAccount> getUserAccountList(String clientId, String keyword, String portalId, String userType, String accountStatus) Return the list of user accounts matching the specified search criteria- Parameters:
clientId
- the OID of the client associated with the user (optional)keyword
- the search keywordportalId
- the OID of a portal associated with the user (optional)userType
- the user type, one ofUserAccount.USER_TYPES
(optional)accountStatus
- the user account status, one ofUserAccount.ACCOUNT_STATUSES
(optional)- Returns:
- the list of matching user accounts
-
getActiveUsersInGroup
Return all active user accounts who are members of a specific group, ordered by login name- Parameters:
groupName
- the non-empty name of the group (required)- Returns:
- the list of users belonging to the group
-
getActiveUsersInGroupWithClientAccess
Return all active user accounts who are members of a specific group, ordered by login name. Only users associated with the specified client (as well as users with the global access flag) will be considered; if no client is specified, only users with the global access flag are considered. If you do not want to filter by client, usegetActiveUsersInGroup(String)
.- Parameters:
groupName
- the non-empty name of the group (required)client
- the organization to filter on (if null, only global administrators are considered)- Returns:
- the list of users belonging to the group
- Since:
- 4.1.13
-
getActiveUsersInGroups
Return all active user accounts who are members of a set of groups, ordered by login name- Parameters:
groupNameSet
- the set of group names to filter on- Returns:
- the list of matching users
- Since:
- 4.1.0
-
getAdminsWithPermission
Return all user accounts for the given client, who also have the specified permission- Parameters:
clientId
- the OID of an existing clientpermissionName
- the non-empty name of the permission- Returns:
- the list of matching user accounts
-
getUserSearch
Return a list of users whose given name, family name, login name or email address contain the search string, or whose OID matches the search string if it is numeric- Parameters:
clientId
- the OID of the client associated with the user accountvalue
- the non-empty search string- Returns:
- the list of matching user accounts
-
getActiveUserAccountsForClient
Return the list of active user accounts associated with a client, ordered by login name- Parameters:
clientId
- the OID of the client (optional)- Returns:
- the list of matching user accounts
-
getActiveUserAccountsForClientIncludeGlobalUsers
Return the list of active user accounts associated with a client and global user accounts, ordered by login name- Parameters:
clientId
- the OID of the client (optional)- Returns:
- the list of matching user accounts
- Since:
- 22.04.5
-
getActiveUsersSubscribedToSubmissionAlerts
Return the list of active users subscribed to theGroup.RECEIVE_DELIVERY_ESCALATION_ALERTS
group for the specified client- Parameters:
clientId
- the OID of the client associated with the user (global users are also returned)- Returns:
- the list of matching users
-
setReceiveSubmissionUpdates
Add the user to / remove the user from theGroup.RECEIVE_SUBMISSION_UPDATES
group- Parameters:
userAccount
- the non-null user accountreceive
- whether to add (true) or remove (false) the user from the group
-
getUnverifiedAccountsToPurge
Return a list of user accounts requiring email verification that are ready to purge, sorted ascending by creation date. Default fetch limits apply.- Returns:
- the list of matching user accounts
-
isClientAccessibleToUser
Checks if is user accessible to client.- Parameters:
userAccount
- the user accountclient
- the client- Returns:
- true, if is user accessible to client
- Since:
- 4.0.0
-
isSubmissionAccessibleToAdministrator
public boolean isSubmissionAccessibleToAdministrator(Submission submission, UserAccount userAccount) Return true if the submission is accessible to the given administrator user.- Parameters:
submission
- the submission recorduserAccount
- the administrative user- Returns:
- true if the submission is accessible to the given administrator user
- Since:
- 4.0.0
-
getAdministratorClients
Return a list of clients the administrator has access to.- Parameters:
loginName
- the administrator login name- Returns:
- a list of clients the administrator has access to
- Since:
- 4.0.0
-
normalizeLogin
Return the normalized login name.- Parameters:
loginName
- the login name- Returns:
- the normalized login name.
- Since:
- 3.6.1
-