Package org.xwiki.security.authorization
Interface AuthorExecutor
-
@Role public interface AuthorExecutor
Allow executing some code with the right of a provided user.- Since:
- 8.3RC1
- Version:
- $Id: f0324d8b8ebe88305c409b927d7295a4e29a0fba $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
after(AutoCloseable context)
Restore the context to it's previous state as defined by the providedAutoCloseable
.AutoCloseable
before(DocumentReference authorReference)
Deprecated.since 10.11RC1, usebefore(DocumentReference, DocumentReference)
insteaddefault AutoCloseable
before(DocumentReference authorReference, DocumentReference sourceReference)
Setup the context so that following code is executed with provided user rights.<V> V
call(Callable<V> callable, DocumentReference authorReference)
Deprecated.since 10.11RC1, usecall(Callable, DocumentReference, DocumentReference)
insteaddefault <V> V
call(Callable<V> callable, DocumentReference authorReference, DocumentReference sourceReference)
Execute the passedCallable
with the rights of the passed user.
-
-
-
Method Detail
-
call
@Deprecated <V> V call(Callable<V> callable, DocumentReference authorReference) throws Exception
Deprecated.since 10.11RC1, usecall(Callable, DocumentReference, DocumentReference)
insteadExecute the passedCallable
with the rights of the passed user.- Type Parameters:
V
- the result type of methodcall
- Parameters:
callable
- the task to executeauthorReference
- the user to check rights on- Returns:
- computed result
- Throws:
Exception
- if unable to compute a result
-
call
default <V> V call(Callable<V> callable, DocumentReference authorReference, DocumentReference sourceReference) throws Exception
Execute the passedCallable
with the rights of the passed user.- Type Parameters:
V
- the result type of methodcall
- Parameters:
callable
- the task to executeauthorReference
- the user to check rights onsourceReference
- the reference of the document associated with theCallable
(which will be used to test the author right)- Returns:
- computed result
- Throws:
Exception
- if unable to compute a result- Since:
- 10.11RC1
-
before
@Deprecated AutoCloseable before(DocumentReference authorReference)
Deprecated.since 10.11RC1, usebefore(DocumentReference, DocumentReference)
insteadSetup the context so that following code is executed with provided user rights.try (AutoCloseable context = this.executor.before(author)) { ... }
- Parameters:
authorReference
- the user to check rights on- Returns:
- the context to restore
- See Also:
after(AutoCloseable)
-
before
default AutoCloseable before(DocumentReference authorReference, DocumentReference sourceReference)
Setup the context so that following code is executed with provided user rights.try (AutoCloseable context = this.executor.before(author, sourceDocument)) { ... }
- Parameters:
authorReference
- the user to check rights onsourceReference
- the reference of the document associated with theCallable
(which will be used to test the author right)- Returns:
- the context to restore
- Since:
- 10.11RC1
- See Also:
after(AutoCloseable)
-
after
void after(AutoCloseable context)
Restore the context to it's previous state as defined by the providedAutoCloseable
.- Parameters:
context
- the context to restore- See Also:
before(DocumentReference)
-
-