@Override
    public void asUser(final UserRef userRef, final Runnable runnable) {
        ensureValidUser(userRef);
        final UserIdentity userIdentity = new BasicUserIdentity(userRef);
        asUser(userIdentity, runnable);
    }
Run the supplied code as the specified user.
stroom-security/stroom-security-impl/src/main/java/stroom/security/impl/SecurityContextImpl.java