@Role
@Unstable
public interface AuthorExecutor
| Modifier and Type | Method and Description |
|---|---|
void |
after(AutoCloseable context)
Restore the context to it's previous state as defined by the provided
AutoCloseable. |
AutoCloseable |
before(DocumentReference authorReference)
Setup the context so that following code is executed with provided user rights.
|
<V> V |
call(Callable<V> callable,
DocumentReference authorReference)
Execute the passed
Callable with the rights of the passed user. |
<V> V call(Callable<V> callable, DocumentReference authorReference) throws Exception
Callable with the rights of the passed user.V - the result type of method callcallable - the the task to executeauthorReference - the user to check rights onException - if unable to compute a resultAutoCloseable before(DocumentReference authorReference)
try (AutoCloseable context = this.executor.before(author)) {
...
}
authorReference - the user to check rights onafter(AutoCloseable)void after(AutoCloseable context)
AutoCloseable.context - the context to restorebefore(DocumentReference)Copyright © 2004–2018 XWiki. All rights reserved.