Interface IUserToken

All Known Subinterfaces:
ISession, IWorkflowSession

public interface IUserToken
The user token interface provides some methods for testing if a user can act as (another) certain user or has a certain role. Note that a user token may act as more than one user and has more roles than a certain user because of sessions roles and user substitutions
Since:
17.05.2006
API:
This is a public API.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tests if the user of this user token currently can act as a certain workflow user.
    has()
    Test if the user of this user token currently owns roles.
    boolean
    hasRole(IRole role, boolean useSessionRoles)
    Test if the user of this user token currently owns a role.
  • Method Details

    • canActAsUser

      boolean canActAsUser(IUser user)
      Tests if the user of this user token currently can act as a certain workflow user. Note that this method does not behave like Object.equals(Object). A user token can act as more than just one workflow user because of substitutions.
      Parameters:
      user - the workflow user to test
      Returns:
      true if token user can act as the workflow user, otherwise false
      See Also:
      • canActAsUser(IUser, SubstituteInclusion)
      API:
      This public API is available in Java.
      Security:
      Session: SESSION MATCHES THIS OR OWNS SessionCanActAsUser PERMISSION OR OWNS SessionCanActAsUser@SYSTEM PERMISSION
      Session: SESSION MATCHES THIS OR OWNS SessionCanActAsUser PERMISSION OR OWNS SessionCanActAsUser@SYSTEM PERMISSION
    • hasRole

      boolean hasRole(IRole role, boolean useSessionRoles)
      Test if the user of this user token currently owns a role. Note, that this method does not behave like IUser.getRoles(). A user token can have more roles than the user itself, because of a session role or substitutions.
      Parameters:
      role - the role to test
      useSessionRoles - if true the temporary session roles are also checked
      Returns:
      true if workflow user has the role,otherwise false
      See Also:
      API:
      This public API is available in Java.
      Security:
      Session: SESSION MATCHES THIS OR OWNS SessionHasRole PERMISSION OR OWNS SessionHasRole@SYSTEM PERMISSION
      Session: SESSION MATCHES THIS OR OWNS SessionHasRole PERMISSION OR OWNS SessionHasRole@SYSTEM PERMISSION
    • has

      Test if the user of this user token currently owns roles.

      Note, that this method does not behave like IUser.getRoles(). A user token can have more roles than the user itself because of substitutions.

      Example:

      ivy.session.has().role("Manager");
      Since:
      9.3
      See Also:
      API:
      This public API is available in Java.