Class RunAsRunner
java.lang.Object
com.evolveum.midpoint.model.impl.security.RunAsRunner
- All Implemented Interfaces:
AutoCloseable
Takes care of optimized "run as" operations.
By optimization we mean that if the currently logged-in user is the same as the one specified in runAs,
no login procedure is carried out.
BEWARE: In order to return the original security context, the close() method must be called.
This object is therefore to be used in try-with-resources context ONLY.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
runAs
(CheckedCommonRunnable runnable, ObjectReferenceType identityRef, OperationResult parentResult)
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
runAs
public void runAs(CheckedCommonRunnable runnable, ObjectReferenceType identityRef, OperationResult parentResult) throws CommonException - Throws:
CommonException
-