public abstract class ThreadLocalTenantGate extends Object
TenantRegistry
.Constructor and Description |
---|
ThreadLocalTenantGate() |
Modifier and Type | Method and Description |
---|---|
static boolean |
hasTenantPermit() |
static <T> Callable<T> |
withoutTenantPermit(Callable<T> callback)
Close all gates for the given closure on the current thread.
|
static <T> Callable<T> |
withTenantPermit(Callable<T> callback)
Open all gates for the given closure on the current thread.
|
static <T> Callable<T> |
wrap(boolean permitted,
Callable<T> callback) |
public static boolean hasTenantPermit()
public static <T> Callable<T> withTenantPermit(Callable<T> callback)
This only makes sense in a pre-tenanted state, e.g. during setup allow code to prepare the database before it's made available to a broader audience.
callback
- the function allowed to pass through the gatepublic static <T> Callable<T> withoutTenantPermit(Callable<T> callback)
This only makes sense in a pre-tenanted state, if you want to ensure that the given code can not access
tenanted resources even though an outer closure might have granted that access, e.g. loading DefaultPluginManager.earlyStartup()
plugins which should not be able to eagerly
access tenanted resources.
callback
- the function allowed to pass through the gateCopyright © 2003–2021 Atlassian. All rights reserved.