diff --git a/source/java/org/alfresco/repo/security/authentication/AuthenticationUtil.java b/source/java/org/alfresco/repo/security/authentication/AuthenticationUtil.java index 7d581f4dee..77913b864a 100644 --- a/source/java/org/alfresco/repo/security/authentication/AuthenticationUtil.java +++ b/source/java/org/alfresco/repo/security/authentication/AuthenticationUtil.java @@ -241,6 +241,14 @@ public abstract class AuthenticationUtil ContextHolder.setContext(null); } + /** + * Execute a unit of work as a given user. The thread's authenticated user will be + * returned to its normal state after the call. + * + * @param runAsWork the unit of work to do + * @param uid the user ID + * @return Returns the work's return value + */ public static R runAs(RunAsWork runAsWork, String uid) { String currentUser = AuthenticationUtil.getCurrentUserName();