public class AuthenticatedUserThreadLocal extends Object
Constructor and Description |
---|
AuthenticatedUserThreadLocal() |
Modifier and Type | Method and Description |
---|---|
static AutoCloseable |
asUser(ConfluenceUser user)
Deprecated.
since 7.14 Prefer
asUser(ConfluenceUser, Runnable) or asUser(ConfluenceUser, Callable) |
static <T> T |
asUser(ConfluenceUser user,
Callable<T> task)
Executes the given
Callable with the given thread-local User. |
static void |
asUser(ConfluenceUser user,
Runnable task)
Executes the given
Runnable with the given thread-local User. |
static ConfluenceUser |
get() |
static com.atlassian.user.User |
getUser()
Deprecated.
since 5.2. Use
get() instead. |
static String |
getUsername() |
static boolean |
isAnonymousUser() |
static void |
reset()
Remove any user from the current context
|
static void |
set(ConfluenceUser user) |
static void |
setUser(com.atlassian.user.User user)
Deprecated.
since 5.2. Use
set(ConfluenceUser) instead. |
public static void set(ConfluenceUser user)
@Deprecated public static void setUser(com.atlassian.user.User user)
set(ConfluenceUser)
instead.public static ConfluenceUser get()
@Deprecated public static com.atlassian.user.User getUser()
get()
instead.public static void reset()
public static String getUsername()
public static boolean isAnonymousUser()
@Deprecated public static AutoCloseable asUser(ConfluenceUser user)
asUser(ConfluenceUser, Runnable)
or asUser(ConfluenceUser, Callable)
public static void asUser(ConfluenceUser user, Runnable task)
Runnable
with the given thread-local User.public static <T> T asUser(ConfluenceUser user, Callable<T> task) throws Exception
Callable
with the given thread-local User.Exception
Copyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences