public class ThreadSecurityManager
extends java.lang.Object
User
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
Constructor and Description |
---|
ThreadSecurityManager() |
Modifier and Type | Method and Description |
---|---|
static void |
clearThreadUser()
Unbinds any existing User object from the current thread.
|
static User |
currentUser()
Returns the User object associated with the current thread.
|
static java.lang.Object |
doAs(User pUser,
Action pAction)
Calls the run() method in a Runnable object, associating the
given User object with the current thread.
|
static void |
setThreadUser(User user)
Binds a new User object to the current thread.
|
public static java.lang.Object doAs(User pUser, Action pAction) throws java.lang.Exception
java.lang.Exception
public static User currentUser()
public static void clearThreadUser()
setThreadUser(atg.security.User)
public static void setThreadUser(User user)
If you would like to temporarily assign an ID to a thread it may be better to use doAs() instead.
This call should be used sparingly, as it is possible to accidentally leave a user bound to the thread, perhaps leading to inadvertent use of the user's identity.