Class User
- java.lang.Object
-
- com.saperion.ngc.model.authorization.User
-
- All Implemented Interfaces:
java.io.Serializable
public class User extends java.lang.Object implements java.io.Serializable
Bean used to store user-information in the current session.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description User(com.saperion.intf.SaUserInfo userInfo, AuthenticationInformation auth)
Creates a new user from a userinfo object.User(AuthenticationInformation auth)
Creates a new user with only the authentication information set.User(com.saperion.users.UserName userName, int uid, boolean isPresent, AuthenticationInformation auth, com.saperion.users.UserFlags userFlags, int mandantId)
Literal constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActiveSession(com.saperion.connector.authentication.Session activeSession)
Add the givenSession
to active session listjava.util.List<com.saperion.connector.authentication.Session>
getActiveSessions()
AuthenticationInformation
getAuthenticationInformation()
com.saperion.connector.authentication.Session
getCurrentSession()
com.saperion.users.UserFlags
getFlags()
int
getId()
int
getMandantId()
com.saperion.users.UserName
getName()
static User
invalidUser()
boolean
isPresent()
boolean
isTechnical()
User
mergePassword(java.lang.String newPassword)
User
mergeShortName(java.lang.String shortName)
void
setCurrentSession(com.saperion.connector.authentication.Session currentSession)
Set the current sessionvoid
setPresent(boolean isPresent)
Sets the present-property.void
setTechnical(boolean technical)
Sets the technical property.void
setWfAllowSubstAccess(boolean accessEnabled)
Sets whether the user's substitute has access to the users workflow-inbox.java.lang.String
toString()
-
-
-
Constructor Detail
-
User
public User(com.saperion.users.UserName userName, int uid, boolean isPresent, AuthenticationInformation auth, com.saperion.users.UserFlags userFlags, int mandantId)
Literal constructor.- Parameters:
userName
- The users nameuid
- The users unique idisPresent
- Whether the user is presentauth
- The information how the user logged in.mandantId
- MandantIduserFlags
- flags for the user
-
User
public User(com.saperion.intf.SaUserInfo userInfo, AuthenticationInformation auth)
Creates a new user from a userinfo object.- Parameters:
userInfo
- detailed user informationauth
- The information how the user logged in
-
User
public User(AuthenticationInformation auth)
Creates a new user with only the authentication information set.- Parameters:
auth
- authentication information
-
-
Method Detail
-
getName
public com.saperion.users.UserName getName()
- Returns:
- the name of the user
-
getId
public int getId()
- Returns:
- the unique id of the user
-
getMandantId
public int getMandantId()
- Returns:
- the unique id of the mandant
-
isPresent
public boolean isPresent()
- Returns:
- whether the user is present
-
setPresent
public void setPresent(boolean isPresent)
Sets the present-property.- Parameters:
isPresent
- if the user is present or not
-
getAuthenticationInformation
public AuthenticationInformation getAuthenticationInformation()
- Returns:
- the information how the user logged in
-
getFlags
public com.saperion.users.UserFlags getFlags()
- Returns:
- detailed information about user options
-
invalidUser
public static User invalidUser()
- Returns:
- an invalid user instance
-
mergeShortName
public User mergeShortName(java.lang.String shortName)
- Parameters:
shortName
- the new short name- Returns:
- an User instance that equals this in every member expcept the displayname (and the login name) which is given.
-
mergePassword
public User mergePassword(java.lang.String newPassword)
- Parameters:
newPassword
- The new password- Returns:
- A User instance that equals is in every member except for the password.
-
setWfAllowSubstAccess
public void setWfAllowSubstAccess(boolean accessEnabled)
Sets whether the user's substitute has access to the users workflow-inbox.- Parameters:
accessEnabled
- if the substitute has access
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isTechnical
public boolean isTechnical()
- Returns:
- true if this is a technical user
-
setTechnical
public void setTechnical(boolean technical)
Sets the technical property.- Parameters:
technical
- set to true if this is a technical user
-
getCurrentSession
public com.saperion.connector.authentication.Session getCurrentSession()
- Returns:
- The current user session
-
setCurrentSession
public void setCurrentSession(com.saperion.connector.authentication.Session currentSession)
Set the current session- Parameters:
currentSession
-
-
getActiveSessions
public java.util.List<com.saperion.connector.authentication.Session> getActiveSessions()
- Returns:
- The other active
Session
s of the user
-
addActiveSession
public void addActiveSession(com.saperion.connector.authentication.Session activeSession)
Add the givenSession
to active session list- Parameters:
activeSession
-
-
-