code: @Nonnull
      public static ACLContext as(@CheckForNull User user) {
          return as(user == null ? Jenkins.ANONYMOUS : user.impersonate());
      }
docs: Changes the {@link Authentication} associated with the current thread to the specified one and returns an
  {@link AutoCloseable} that restores the previous security context.
  
  <p>
  This makes impersonation much easier within code as it can now be used using the try with resources construct:
  <pre>
  try (ACLContext ctx = ACL.as(auth)) {
  ...
  }
  </pre>
  
  @param user the user to impersonate.
  @return the previous authentication context
  @since 2.14