@PublicApi
public interface CustomerContextService
This service allows you to setup customer context, execute some code and have the special JIRA Service Desk permissions apply to that called code.
Normally on the JIRA platform, only licensed users can login and get permission-ed access to services. JIRA Service Desk, however, allows exceptions to this. In JIRA Service Desk EVERY named user is considered a "customer" when they are asking for help. This service allows you to enter a "customer context" to run code in the name of that user (free or otherwise).
WARNING : It is a breach of the JIRA and JIRA Service Desk licence agreements to use this mechanism to subvert the software's terms and conditions. You must only use these methods when you are calling code services on behalf of customers, where that work is related to JIRA Service Desk.
Modifier and Type | Method and Description |
---|---|
boolean |
isInCustomerContext() |
<T> T |
runInCustomerContext(NoExceptionsCallable<T> callable)
Executes the code in a "customer context".
|
void |
runInCustomerContext(Runnable runnable)
Executes the code in a "customer context".
|
<T> T |
runOutOfCustomerContext(NoExceptionsCallable<T> callable)
Executes the code out of a "customer context".
|
void |
runOutOfCustomerContext(Runnable runnable)
Executes the code out of a "customer context".
|
<T> T runInCustomerContext(NoExceptionsCallable<T> callable)
This method is re-entrant and can be called multiple times within the same thread.
T
- the return typecallable
- the code to executevoid runInCustomerContext(Runnable runnable)
This method is re-entrant and can be called multiple times within the same thread.
runnable
- the code to execute<T> T runOutOfCustomerContext(NoExceptionsCallable<T> callable)
This method is re-entrant and can be called multiple times within the same thread.
T
- the return typecallable
- the code to executevoid runOutOfCustomerContext(Runnable runnable)
This method is re-entrant and can be called multiple times within the same thread.
runnable
- the code to executeboolean isInCustomerContext()
Copyright © 2020 Atlassian. All rights reserved.