raducotescu commented on code in PR #43: URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/43#discussion_r1605239318
########## src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrProviderStateFactory.java: ########## @@ -111,7 +111,20 @@ private static Bundle extractCallingBundle(@NotNull Map<String, Object> authenti } else { final Object subService = authenticationInfo.get(ResourceResolverFactory.SUBSERVICE); final String subServiceName = subService instanceof String ? (String) subService : null; - session = repo.loginService(subServiceName, null); + // let's shortcut the impersonation for service users, if impersonation was requested + String sudoUser = getSudoUser(authenticationInfo); + if (sudoUser != null) { + SimpleCredentials creds = new SimpleCredentials(sudoUser, new char[0]); + creds.setAttribute(ResourceResolver.USER_IMPERSONATOR, subServiceName == null ? Review Comment: That attribute seems to be retrieved via `org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider#getAttribute` for `org.apache.sling.api.resource.ResourceResolver#getAttribute` calls. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org