Interface IUser
-
- All Superinterfaces:
ISecurityMember
public interface IUser extends ISecurityMember
A user- Since:
- 17.05.2006
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRole(IRole role)
Add a role the user can act asIUserAbsence
createAbsence(Date startDateInclusive, Date stopDateInclusive, String description)
Creates a new absence for a time period.IUserSubstitute
createSubstitute(IUser mySubstitute, IRole forThisRole, String description)
Creates a new substitute for a specific role.IUserSubstitute
createSubstitute(IUser mySubstitute, String description, SubstitutionType type)
Creates a new substitute for personal tasks.void
deleteAbsence(IUserAbsence absence)
Deletes a absencevoid
deleteSubstitute(IUserSubstitute substitute)
Deletes a substituteList<IUserAbsence>
getAbsences()
Gets all absences of the userList<IUserSubstitute>
getActiveSubstitutions()
Gets all active user substitutes where this user is the substitute userList<String>
getAllPropertyNames()
Gets all property names of the userList<IRole>
getAllRoles()
Get all roles the user owns (directly and indirectly)String
getEMailAddress()
Gets the e-mail address of the userLocale
getEMailLanguage()
Gets the email language of the user, used for the email notification mails.IUserEMailNotificationSettings
getEMailNotificationSettings()
Gets the email notification settings of this user.String
getExternalSecurityName()
Gets the external security name of this userString
getFullName()
Returns the full name of the userString
getProperty(String name)
Gets a property of the userList<IRole>
getRoles()
Get roles the user owns directList<IUserSubstitute>
getSubstitutes()
Gets all substitutes.List<IUserSubstitute>
getSubstitutions()
Gets all user substitutes where this user is the substitute userIUserToken
getUserToken()
Gets a user token for this userboolean
isAbsent()
Is the session user currently absent.ILocationService
locations()
Gets the locations of the user.String
removeProperty(String name)
Removes a property from the uservoid
removeRole(IRole role)
Remove a role the user can act asvoid
setEMailAddress(String eMailAddress)
Sets the e-mail address of the uservoid
setEMailLanguage(Locale defaultLanguage)
Sets the email language of the user, used for the email notification mails.void
setEMailNotificationSettings(IUserEMailNotificationSettings settings)
Sets the email notification settings of this user.void
setFullName(String fullUserName)
Sets the full name of the uservoid
setPassword(String password)
Sets the password of the uservoid
setProperty(String name, String value)
Sets a property to the user-
Methods inherited from interface ch.ivyteam.ivy.security.ISecurityMember
getDisplayName, getId, getMemberName, getName, getSecurityContext, isMember, isUser
-
-
-
-
Method Detail
-
getFullName
String getFullName()
Returns the full name of the user- Returns:
- full name of the user
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnFullName PERMISSION) OR OWNS UserReadFullName PERMISSION OR OWNS UserReadFullName@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnFullName PERMISSION) OR OWNS UserReadFullName PERMISSION OR OWNS UserReadFullName@SYSTEM PERMISSION
-
setFullName
void setFullName(String fullUserName)
Sets the full name of the user- Parameters:
fullUserName
- the full name of the user- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserSetOwnFullName PERMISSION) OR OWNS UserSetFullName PERMISSION OR OWNS UserSetFullName@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserSetOwnFullName PERMISSION) OR OWNS UserSetFullName PERMISSION OR OWNS UserSetFullName@SYSTEM PERMISSION
-
getEMailLanguage
Locale getEMailLanguage()
Gets the email language of the user, used for the email notification mails.If
null
the default email language of the application is used.- Returns:
- email language, can be
null
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnEMailLanguage PERMISSION) OR OWNS UserReadEMailLanguage PERMISSION OR OWNS UserReadEMailLanguage@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnEMailLanguage PERMISSION) OR OWNS UserReadEMailLanguage PERMISSION OR OWNS UserReadEMailLanguage@SYSTEM PERMISSION
-
setEMailLanguage
void setEMailLanguage(Locale defaultLanguage)
Sets the email language of the user, used for the email notification mails.If
null
the default email language of the application is used.- Parameters:
defaultLanguage
- default language of the user, can benull
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserSetOwnEMailLanguage PERMISSION) OR OWNS UserSetEMailLanguage PERMISSION OR OWNS UserSetEMailLanguage@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserSetOwnEMailLanguage PERMISSION) OR OWNS UserSetEMailLanguage PERMISSION OR OWNS UserSetEMailLanguage@SYSTEM PERMISSION
-
setPassword
void setPassword(String password)
Sets the password of the user- Parameters:
password
- the new password- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserSetOwnPassword PERMISSION) OR OWNS UserSetPassword PERMISSION OR OWNS UserSetPassword@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserSetOwnPassword PERMISSION) OR OWNS UserSetPassword PERMISSION OR OWNS UserSetPassword@SYSTEM PERMISSION
-
addRole
void addRole(IRole role)
Add a role the user can act as- Parameters:
role
- The role to add- Throws:
PersistencyException
- if persistency access fails- See Also:
IRole
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION OWNS UserAddRole PERMISSION OR OWNS UserAddRole@SYSTEM PERMISSION
User: SESSION OWNS UserAddRole PERMISSION OR OWNS UserAddRole@SYSTEM PERMISSION
-
removeRole
void removeRole(IRole role)
Remove a role the user can act as- Parameters:
role
- The role to remove- Throws:
PersistencyException
- if persistency access fails- See Also:
IRole
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION OWNS UserRemoveRole PERMISSION OR OWNS UserRemoveRole@SYSTEM PERMISSION
User: SESSION OWNS UserRemoveRole PERMISSION OR OWNS UserRemoveRole@SYSTEM PERMISSION
-
getRoles
List<IRole> getRoles()
Get roles the user owns direct- Returns:
- list with roles
- Throws:
PersistencyException
- if persistency access fails- See Also:
IRole
,getAllRoles()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnRoles PERMISSION) OR OWNS UserReadRoles PERMISSION OR OWNS UserReadRoles@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnRoles PERMISSION) OR OWNS UserReadRoles PERMISSION OR OWNS UserReadRoles@SYSTEM PERMISSION
-
getAllRoles
List<IRole> getAllRoles()
Get all roles the user owns (directly and indirectly)- Returns:
- list with roles
- Throws:
PersistencyException
- if persistency access fails- See Also:
IRole
,getRoles()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnRoles PERMISSION) OR OWNS UserReadRoles PERMISSION OR OWNS UserReadRoles@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnRoles PERMISSION) OR OWNS UserReadRoles PERMISSION OR OWNS UserReadRoles@SYSTEM PERMISSION
-
setProperty
void setProperty(String name, String value)
Sets a property to the user- Parameters:
name
- Name of the property to set (maximum 255 characters)value
- Value of the property to set- Throws:
IllegalArgumentException
- If the property name has more than 255 charactersPersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserSetOwnProperty PERMISSION) OR OWNS UserSetProperty PERMISSION OR OWNS UserSetProperty@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserSetOwnProperty PERMISSION) OR OWNS UserSetProperty PERMISSION OR OWNS UserSetProperty@SYSTEM PERMISSION
-
getProperty
String getProperty(String name)
Gets a property of the user- Parameters:
name
- Name of the property- Returns:
- property value or null if no such property exists
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnProperty PERMISSION) OR OWNS UserReadProperty PERMISSION OR OWNS UserReadProperty@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnProperty PERMISSION) OR OWNS UserReadProperty PERMISSION OR OWNS UserReadProperty@SYSTEM PERMISSION
-
removeProperty
String removeProperty(String name)
Removes a property from the user- Parameters:
name
- Name of the property to remove- Returns:
- property value or null if no such property exists
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserRemoveOwnProperty PERMISSION) OR OWNS UserRemoveProperty PERMISSION OR OWNS UserRemoveProperty@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserRemoveOwnProperty PERMISSION) OR OWNS UserRemoveProperty PERMISSION OR OWNS UserRemoveProperty@SYSTEM PERMISSION
-
getAllPropertyNames
List<String> getAllPropertyNames()
Gets all property names of the user- Returns:
- Enumeration with the property names
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnPropertyNames PERMISSION) OR OWNS UserReadPropertyNames PERMISSION OR OWNS UserReadPropertyNames@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnPropertyNames PERMISSION) OR OWNS UserReadPropertyNames PERMISSION OR OWNS UserReadPropertyNames@SYSTEM PERMISSION
-
getEMailAddress
String getEMailAddress()
Gets the e-mail address of the user- Returns:
- e-mail address
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnEMailAddress PERMISSION) OR OWNS UserReadEMailAddress PERMISSION OR OWNS UserReadEMailAddress@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnEMailAddress PERMISSION) OR OWNS UserReadEMailAddress PERMISSION OR OWNS UserReadEMailAddress@SYSTEM PERMISSION
-
setEMailAddress
void setEMailAddress(String eMailAddress)
Sets the e-mail address of the user- Parameters:
eMailAddress
- the new e-mail address to set- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserSetOwnEMailAddress PERMISSION) OR OWNS UserSetEMailAddress PERMISSION OR OWNS UserSetEMailAddress@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserSetOwnEMailAddress PERMISSION) OR OWNS UserSetEMailAddress PERMISSION OR OWNS UserSetEMailAddress@SYSTEM PERMISSION
-
createAbsence
IUserAbsence createAbsence(Date startDateInclusive, Date stopDateInclusive, String description)
Creates a new absence for a time period.Absence is calculated on the exact date:time basis, so that please set absences exactly (e.g. from 0:00 of the starting day till 23:59 of the last absence day)
- Parameters:
startDateInclusive
- the start date of the absence (from specified date:time; null is not acceptable)stopDateInclusive
- the stop date of the absence (until specifieddate:time
; Recommended to set 23:59 on the last day). Null means open enddescription
- textual description of this absence- Returns:
- the new absence
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserCreateOwnAbsence PERMISSION) OR OWNS UserCreateAbsence PERMISSION OR OWNS UserCreateAbsence@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserCreateOwnAbsence PERMISSION) OR OWNS UserCreateAbsence PERMISSION OR OWNS UserCreateAbsence@SYSTEM PERMISSION
-
deleteAbsence
void deleteAbsence(IUserAbsence absence)
Deletes a absence- Parameters:
absence
- the absence to delete- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserDeleteOwnAbsence PERMISSION) OR OWNS UserDeleteAbsence PERMISSION OR OWNS UserDeleteAbsence@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserDeleteOwnAbsence PERMISSION) OR OWNS UserDeleteAbsence PERMISSION OR OWNS UserDeleteAbsence@SYSTEM PERMISSION
-
getAbsences
List<IUserAbsence> getAbsences()
Gets all absences of the user- Returns:
- iterator with the absences
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnAbsences PERMISSION) OR OWNS UserReadAbsences PERMISSION OR OWNS UserReadAbsences@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnAbsences PERMISSION) OR OWNS UserReadAbsences PERMISSION OR OWNS UserReadAbsences@SYSTEM PERMISSION
-
isAbsent
boolean isAbsent()
Is the session user currently absent.Absence is calculated on exact date:time base, so that please set absences exactly
(e.g. till 23:59 of selected day if you want an absence for the whole day)- Returns:
- true if it is absent, otherwise false
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
createSubstitute
IUserSubstitute createSubstitute(IUser mySubstitute, IRole forThisRole, String description)
Creates a new substitute for a specific role. For personal substitution usecreateSubstitute(IUser mySubstitute, String description, SubstitutionType type)
instead.- Parameters:
mySubstitute
- a user which is the substitute of this userforThisRole
- a role for which the substitute user substitutes medescription
- the description- Returns:
- the new substitute
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserCreateOwnSubstitute PERMISSION) OR OWNS UserCreateSubstitute PERMISSION OR OWNS UserCreateSubstitute@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserCreateOwnSubstitute PERMISSION) OR OWNS UserCreateSubstitute PERMISSION OR OWNS UserCreateSubstitute@SYSTEM PERMISSION
-
createSubstitute
IUserSubstitute createSubstitute(IUser mySubstitute, String description, SubstitutionType type)
Creates a new substitute for personal tasks. For role substitution usecreateSubstitute(IUser mySubstitute, IRole role, String description)
instead.- Parameters:
mySubstitute
- a user which is the substitute of this userdescription
- the descriptiontype
- when is the substitute active.- Returns:
- the new substitute
- Throws:
PersistencyException
- if persistency access fails- Since:
- 7.3
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserCreateOwnSubstitute PERMISSION) OR OWNS UserCreateSubstitute PERMISSION OR OWNS UserCreateSubstitute@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserCreateOwnSubstitute PERMISSION) OR OWNS UserCreateSubstitute PERMISSION OR OWNS UserCreateSubstitute@SYSTEM PERMISSION
-
deleteSubstitute
void deleteSubstitute(IUserSubstitute substitute)
Deletes a substitute- Parameters:
substitute
- the substitute to delete- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserDeleteOwnSubstitute PERMISSION) OR OWNS UserDeleteSubstitute PERMISSION OR OWNS UserDeleteSubstitute@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserDeleteOwnSubstitute PERMISSION) OR OWNS UserDeleteSubstitute PERMISSION OR OWNS UserDeleteSubstitute@SYSTEM PERMISSION
-
getSubstitutes
List<IUserSubstitute> getSubstitutes()
Gets all substitutes. A substitute is a user which acts as a substitute for one of my roles (or personally) during my absences.- Returns:
- iterator with all substitutes
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnSubstitutes PERMISSION) OR OWNS UserReadSubstitutes PERMISSION OR OWNS UserReadSubstitutes@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnSubstitutes PERMISSION) OR OWNS UserReadSubstitutes PERMISSION OR OWNS UserReadSubstitutes@SYSTEM PERMISSION
-
getEMailNotificationSettings
IUserEMailNotificationSettings getEMailNotificationSettings()
Gets the email notification settings of this user.If
IUserEMailNotificationSettings.isUseApplicationDefault()
set totrue
the application default settings are used.- Returns:
- email notification settings of this user.
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnEMailNotification PERMISSION) OR OWNS UserReadEMailNotification PERMISSION OR OWNS UserReadEMailNotification@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnEMailNotification PERMISSION) OR OWNS UserReadEMailNotification PERMISSION OR OWNS UserReadEMailNotification@SYSTEM PERMISSION
-
setEMailNotificationSettings
void setEMailNotificationSettings(IUserEMailNotificationSettings settings)
Sets the email notification settings of this user.If
IUserEMailNotificationSettings.isUseApplicationDefault()
set totrue
the application default settings are used.- Parameters:
settings
- the email notification settings to set.- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserSetOwnEMailNotification PERMISSION) OR OWNS UserSetEMailNotification PERMISSION OR OWNS UserSetEMailNotification@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserSetOwnEMailNotification PERMISSION) OR OWNS UserSetEMailNotification PERMISSION OR OWNS UserSetEMailNotification@SYSTEM PERMISSION
-
getUserToken
IUserToken getUserToken()
Gets a user token for this user- Returns:
- The user token
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getSubstitutions
List<IUserSubstitute> getSubstitutions()
Gets all user substitutes where this user is the substitute user- Returns:
- list with user substitutes
- Throws:
PersistencyException
- if persistency access fails- See Also:
getActiveSubstitutions()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnSubstitutions PERMISSION) OR OWNS UserReadSubstitutions PERMISSION OR OWNS UserReadSubstitutions@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnSubstitutions PERMISSION) OR OWNS UserReadSubstitutions PERMISSION OR OWNS UserReadSubstitutions@SYSTEM PERMISSION
-
getActiveSubstitutions
List<IUserSubstitute> getActiveSubstitutions()
Gets all active user substitutes where this user is the substitute user- Returns:
- list with active user substitutes
- Throws:
PersistencyException
- if persistency access fails- See Also:
getSubstitutions()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getExternalSecurityName
String getExternalSecurityName()
Gets the external security name of this user- Returns:
- external security name
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- JndiUser: SESSION (MATCHES THIS AND OWNS UserReadOwnExternalSecurityName PERMISSION) OR OWNS UserReadExternalSecurityName PERMISSION OR OWNS UserReadExternalSecurityName@SYSTEM PERMISSION
User: SESSION (MATCHES THIS AND OWNS UserReadOwnExternalSecurityName PERMISSION) OR OWNS UserReadExternalSecurityName PERMISSION OR OWNS UserReadExternalSecurityName@SYSTEM PERMISSION
-
locations
ILocationService locations()
Gets the locations of the user.
Example:
import ch.ivyteam.ivy.location.ILocation; ILocation location = ivy.session.getSessionUser().locations().getLatest(); if (location != null) { ivy.log.info("Last known position of user "+ivy.session.getSessionUserName()+" was "+location.getPosition()); }
- Returns:
- location service
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
-