Interface IUser

All Superinterfaces:
ISecurityMember

public interface IUser extends ISecurityMember
A user
Since:
17.05.2006
API:
This is a public API.
  • Method Details

    • 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 Java.
      Security:
      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 Java.
      Security:
      SESSION (MATCHES THIS AND OWNS UserSetOwnFullName PERMISSION) OR OWNS UserSetFullName PERMISSION OR OWNS UserSetFullName@SYSTEM PERMISSION
    • getEMailLanguage

      @Deprecated(since="9.3") default Locale getEMailLanguage()
      Deprecated.
      API:
      This public API is available in Java.
    • getLanguage

      Locale getLanguage()
      Gets the language of the user
      Returns:
      language, can be null
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      SESSION (MATCHES THIS AND OWNS UserReadOwnEMailLanguage PERMISSION) OR OWNS UserReadEMailLanguage PERMISSION OR OWNS UserReadEMailLanguage@SYSTEM PERMISSION
    • setEMailLanguage

      @Deprecated(since="9.3") default void setEMailLanguage(Locale defaultLanguage)
      Deprecated.
      API:
      This public API is available in Java.
    • setLanguage

      void setLanguage(Locale language)
      Sets the language of the user.
      Parameters:
      language - of the user, can be null
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      SESSION (MATCHES THIS AND OWNS UserSetOwnEMailLanguage PERMISSION) OR OWNS UserSetEMailLanguage PERMISSION OR OWNS UserSetEMailLanguage@SYSTEM PERMISSION
    • setExternalSecurityName

      @Deprecated(since="9.1") void setExternalSecurityName(String externalName)
      Deprecated.
      This method is only executable for the system user Sets the full qualified name of the user in the external security system. It's strongly recommended to leave this to the import and not set the external name manually.
      Parameters:
      externalName -
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
    • setExternalName

      void setExternalName(String externalName)
      This method is only executable for the system user Sets the full qualified name of the user in the external security system. It's strongly recommended to leave this to the import and not set the external name manually.
      Parameters:
      externalName -
      Throws:
      PersistencyException - if persistency access fails
      Since:
      9.1
      API:
      This public API is available in Java.
      Security:
      SESSION IS SYSTEM
    • 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 Java.
      Security:
      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:
      API:
      This public API is available in Java.
      Security:
      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:
      API:
      This public API is available in Java.
      Security:
      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:
      API:
      This public API is available in Java.
      Security:
      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:
      API:
      This public API is available in Java.
      Security:
      SESSION (MATCHES THIS AND OWNS UserReadOwnRoles PERMISSION) OR OWNS UserReadRoles PERMISSION OR OWNS UserReadRoles@SYSTEM PERMISSION
    • has

      Test if the user owns roles.

      Example:

      
       IUser user = ...;
       user.has().role("Manager");
      Since:
      9.3
      See Also:
      API:
      This public API is available in Java.
    • 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 characters
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      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 Java.
      Security:
      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 Java.
      Security:
      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 Java.
      Security:
      SESSION (MATCHES THIS AND OWNS UserReadOwnPropertyNames PERMISSION) OR OWNS UserReadPropertyNames PERMISSION OR OWNS UserReadPropertyNames@SYSTEM PERMISSION
    • isPropertyBacked

      boolean isPropertyBacked(String name)
      Indicates whether the given property is backed in an external directory (e.g. Microsoft AD oder Novell eDirectory).
      Parameters:
      name - the name of the property
      Returns:
      true, if the property is backed; false if not
      Throws:
      PersistencyException
      API:
      This public API is available in Java.
    • 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 Java.
      Security:
      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 Java.
      Security:
      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 specified date:time; Recommended to set 23:59 on the last day). Null means open end
      description - textual description of this absence
      Returns:
      the new absence
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      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 Java.
      Security:
      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 Java.
      Security:
      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 Java.
    • createSubstitute

      IUserSubstitute createSubstitute(IUser mySubstitute, IRole forThisRole, String description)
      Creates a new substitute for a specific role. For personal substitution use createSubstitute(IUser mySubstitute, String description, SubstitutionType type) instead.
      Parameters:
      mySubstitute - a user which is the substitute of this user
      forThisRole - a role for which the substitute user substitutes me
      description - the description
      Returns:
      the new substitute
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      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 use createSubstitute(IUser mySubstitute, IRole role, String description) instead.
      Parameters:
      mySubstitute - a user which is the substitute of this user
      description - the description
      type - 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 Java.
      Security:
      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 Java.
      Security:
      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 Java.
      Security:
      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 to true 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 Java.
      Security:
      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 to true 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 Java.
      Security:
      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 Java.
    • 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:
      API:
      This public API is available in Java.
      Security:
      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:
      API:
      This public API is available in Java.
    • getExternalSecurityName

      @Deprecated(since="9.1") default String getExternalSecurityName()
      Deprecated.
      use getExternalName() instead
      Gets the name of the user in the external security system
      Returns:
      external security user name maybe null
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
    • getExternalName

      String getExternalName()
      Gets the full qualified name of the user in the external security system
      Returns:
      full qualified user name in the external security, maybe null
      Throws:
      PersistencyException - if persistency access fails
      Since:
      9.1
      API:
      This public API is available in Java.
      Security:
      SESSION (MATCHES THIS AND OWNS UserReadOwnExternalSecurityName PERMISSION) OR OWNS UserReadExternalSecurityName PERMISSION OR OWNS UserReadExternalSecurityName@SYSTEM PERMISSION
    • getExternalId

      String getExternalId()
      Gets the id of this user in the external security system
      Returns:
      external security user id maybe null
      Throws:
      PersistencyException - if persistency access fails
      Since:
      9.1
      API:
      This public API is available in Java.
    • isExternal

      boolean isExternal()
      Whether or not the user is managed by an external security system.
      Returns:
      true if its managed by an external security system otherwise false.
      Since:
      9.1
      API:
      This public API is available in Java.
    • 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 Java.