@java.lang.SuppressWarnings("unused") public interface UserFacade
For information about the user and user preferences (including locale, time zone, currency, etc).
Type Params | Return Type | Name and description |
---|---|---|
|
public java.lang.String |
getClientIp()
|
|
public java.util.Map<java.lang.String, java.lang.Object> |
getContext() A per-user context like the execution context for but data specific to a user and maintained through service calls, etc unlike ExecutionContext.getContext(). |
|
public java.lang.String |
getCurrencyUomId()
|
|
public java.util.Locale |
getLocale()
|
|
public java.lang.String |
getLoginKey() Get a login key for the active user. |
|
public java.lang.String |
getLoginKey(float expireHours) |
|
public java.util.Calendar |
getNowCalendar() Get a Calendar object with user's TimeZone and Locale set, and set to same time as returned by getNowTimestamp(). |
|
public java.sql.Timestamp |
getNowTimestamp() Get the current date and time in a Timestamp object. |
|
public java.lang.String |
getPeriodDescription(java.lang.String period, java.lang.String poffset, java.lang.String pdate) |
|
public java.util.ArrayList<java.sql.Timestamp> |
getPeriodRange(java.lang.String period, java.lang.String poffset, java.lang.String pdate) Get a Timestamp range (from/thru) based on period (day, week, month, year; 7d, 30d, etc), offset, and anchor date (defaults to now) |
|
public java.util.ArrayList<java.sql.Timestamp> |
getPeriodRange(java.lang.String period, int poffset, java.sql.Date pdate) |
|
public java.util.ArrayList<java.sql.Timestamp> |
getPeriodRange(java.lang.String period, java.lang.String poffset) |
|
public java.util.ArrayList<java.sql.Timestamp> |
getPeriodRange(java.lang.String baseName, java.util.Map<java.lang.String, java.lang.Object> inputFieldsMap) |
|
public java.lang.String |
getPreference(java.lang.String preferenceKey) Get the value of a user preference. |
|
public java.util.Map<java.lang.String, java.lang.String> |
getPreferences(java.lang.String keyRegexp) Get a Map with multiple preferences, optionally filtered by a regular expression matched against each key |
|
public java.util.TimeZone |
getTimeZone()
|
|
public EntityValue |
getUserAccount()
|
|
public java.util.Set<java.lang.String> |
getUserGroupIdSet() |
|
public java.lang.String |
getUserId()
|
|
public java.lang.String |
getUsername()
|
|
public EntityValue |
getVisit()
|
|
public java.lang.String |
getVisitId()
|
|
public java.lang.String |
getVisitUserId()
|
|
public java.lang.String |
getVisitorId() |
|
public boolean |
hasPermission(java.lang.String userPermissionId) Check to see if current user has the given permission. |
|
public boolean |
isInGroup(java.lang.String userGroupId) Check to see if current user is in the given group (UserGroup). |
|
public boolean |
loginAnonymousIfNoUser() If no user is logged in consider an anonymous user logged in. |
|
public boolean |
loginUser(java.lang.String username, java.lang.String password) Authenticate a user and make active in this ExecutionContext (and session of WebExecutionContext if applicable). |
|
public boolean |
loginUserKey(java.lang.String loginKey) Authenticate a user and make active using a login key |
|
public void |
logoutUser() Remove (logout) active user. |
|
public void |
setCurrencyUomId(java.lang.String uomId) Set the user's Time Zone. |
|
public void |
setEffectiveTime(java.sql.Timestamp effectiveTime) Set an EffectiveTime for the current context which will then be returned from the getNowTimestamp() method. |
|
public void |
setLocale(java.util.Locale locale) Set the user's Locale. |
|
public void |
setPreference(java.lang.String preferenceKey, java.lang.String preferenceValue) Set the value of a user preference. |
|
public void |
setTimeZone(java.util.TimeZone tz) Set the user's Time Zone. |
A per-user context like the execution context for but data specific to a user and maintained through service calls, etc unlike ExecutionContext.getContext(). Used for security data, etc such as entity filter values.
Get a login key for the active user. By default expires in the number of hours configured in the Conf XML file in: user-facade.login-key.@expire-hours
Get a Calendar object with user's TimeZone and Locale set, and set to same time as returned by getNowTimestamp().
Get the current date and time in a Timestamp object. This is either the current system time, or the Effective Time if that has been set for this context (allowing testing of past and future system behavior). All internal tools and code built on the framework should treat this as the actual current time.
Get a Timestamp range (from/thru) based on period (day, week, month, year; 7d, 30d, etc), offset, and anchor date (defaults to now)
Get the value of a user preference.
preferenceKey
- The key for the preference, looked up on UserPreference.preferenceKeyGet a Map with multiple preferences, optionally filtered by a regular expression matched against each key
Check to see if current user has the given permission. To have a permission a user must be in a group (UserGroupMember => UserGroup) that has the given permission (UserGroupPermission).
userPermissionId
- Permission ID for record in UserPermission or any arbitrary permission name (does
not have to be pre-configured, ie does not have to be in the UserPermission entity's table)Check to see if current user is in the given group (UserGroup). The user group concept in Moqui is similar to the "role" concept in many security contexts (including Apache Shiro which is used in Moqui) though that term is avoided because of the use of the term "role" for the Party part of the Mantle Universal Data Model.
userGroupId
- The user group ID to check against.If no user is logged in consider an anonymous user logged in. For internal purposes to run things that require authentication.
Authenticate a user and make active in this ExecutionContext (and session of WebExecutionContext if applicable).
username
- An ID to match the UserAccount.username field.password
- The user's current password.Authenticate a user and make active using a login key
Remove (logout) active user.
Set the user's Time Zone. This is used in this context and saved to the database for future contexts.
uomId
- The new currency UOM ID (ISO currency code).Set an EffectiveTime for the current context which will then be returned from the getNowTimestamp() method. This is used to test past and future behavior of applications.
effectiveTime
- The new effective date/time. Pass in null to reset to the default of the current system time.Set the user's Locale. This is used in this context and saved to the database for future contexts.
locale
- The new Locale.Set the value of a user preference.
preferenceKey
- The key for the preference, used to create or update a record with UserPreference.preferenceKeypreferenceValue
- The value to set on the preference, set in UserPreference.preferenceValueSet the user's Time Zone. This is used in this context and saved to the database for future contexts.
tz
- The new TimeZone.