Package ch.ivyteam.ivy.security
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 TypeMethodDescriptionbooleancanActAsUser(IUser user) 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.booleanTest if the user of this user token currently owns a role.
-
Method Details
-
canActAsUser
Tests if the user of this user token currently can act as a certain workflow user. Note that this method does not behave likeObject.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:
- 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
Test if the user of this user token currently owns a role. Note, that this method does not behave likeIUser.getRoles(). A user token can have more roles than the user itself, because of a session role or substitutions.- Parameters:
role- the role to testuseSessionRoles- 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
IRoleMatcher 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.
-