### CI Link

https://gradle-enterprise.elastic.co/s/ozb6lycxc43es/console-log?task=:security-authorization-engine:compileJava

### Repro line

cd plugin/examples; ./gradlew build --include-build ../..

### Does it reproduce?

Yes

### Applicable branches

master

### Failure history

_No response_

### Failure excerpt

After merging https://github.com/elastic/elasticsearch/pull/86246 example builds started failing with compilation errors 

```
> Task :security-authorization-engine:compileJava FAILED
/Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java:50: error: cannot find symbol
        if (authentication.getUser().isRunAs()) {
                                    ^
  symbol:   method isRunAs()
  location: class User
/Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java:52: error: cannot find symbol
                new CustomAuthorizationInfo(authentication.getUser().authenticatedUser().roles(), null);
                                                                    ^
  symbol:   method authenticatedUser()
  location: class User
/Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java:61: error: cannot find symbol
        if (isSuperuser(requestInfo.getAuthentication().getUser().authenticatedUser())) {
                                                                 ^
  symbol:   method authenticatedUser()
  location: class User
Note: /Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors

```
plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java
import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse;
import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse.Indices;
import org.elasticsearch.xpack.core.security.action.user.HasPrivilegesRequest;
import org.elasticsearch.xpack.core.security.action.user.HasPrivilegesResponse;
import org.elasticsearch.xpack.core.security.authc.Authentication;
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine;
import org.elasticsearch.xpack.core.security.authz.ResolvedIndices;
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor;
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor.IndicesPrivileges;
import org.elasticsearch.xpack.core.security.authz.accesscontrol.IndicesAccessControl;
import org.elasticsearch.xpack.core.security.authz.accesscontrol.IndicesAccessControl.IndexAccessControl;
import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissions;
import org.elasticsearch.xpack.core.security.authz.permission.ResourcePrivileges;
import org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilegeDescriptor;
import org.elasticsearch.xpack.core.security.authz.privilege.ConfigurableClusterPrivilege;
import org.elasticsearch.xpack.core.security.user.User;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
 * A custom implementation of an authorization engine. This engine is extremely basic in that it
 * authorizes based upon the name of a single role. If users have this role they are granted access.
 */
public class CustomAuthorizationEngine implements AuthorizationEngine {