You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Ankush Malhotra <am...@adobe.com> on 2014/08/08 10:03:05 UTC

Getting impersonator from resourceresolver

Hi devs,
Is there a way to find the impersonating user from resolver rather than the user being impersonated[1]. There are certain auditing requirements where the power user performing(impersonating) action on behalf of someone needs to be logged in audit records.
-Ankush

[1]https://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceResolver.html#getUserID()

Re: Getting impersonator from resourceresolver

Posted by Felix Meschberger <fm...@adobe.com>.
Hi Ankush

Am 08.08.2014 um 10:59 schrieb Ankush Malhotra <am...@adobe.com>:

> This works
> resolver().getAttribute(org.apache.sling.api.resource.ResourceResolver.USER_IMPERSONATOR);
> is it ok to use, is there a better way?

Yes, looking at the JavaDoc I think I remember we introduced that attribute exactly for that purpose.

Regards
Felix

> 
> From: Ankush Malhotra <am...@adobe.com>>
> Date: Friday, August 8, 2014 1:33 PM
> To: "dev@sling.apache.org<ma...@sling.apache.org>" <de...@sling.apache.org>>
> Subject: Getting impersonator from resourceresolver
> 
> Hi devs,
> Is there a way to find the impersonating user from resolver rather than the user being impersonated[1]. There are certain auditing requirements where the power user performing(impersonating) action on behalf of someone needs to be logged in audit records.
> -Ankush
> 
> [1]https://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceResolver.html#getUserID()


RE: Getting impersonator from resourceresolver

Posted by Ankush Malhotra <am...@adobe.com>.
This works
resolver().getAttribute(org.apache.sling.api.resource.ResourceResolver.USER_IMPERSONATOR);
is it ok to use, is there a better way?

From: Ankush Malhotra <am...@adobe.com>>
Date: Friday, August 8, 2014 1:33 PM
To: "dev@sling.apache.org<ma...@sling.apache.org>" <de...@sling.apache.org>>
Subject: Getting impersonator from resourceresolver

Hi devs,
Is there a way to find the impersonating user from resolver rather than the user being impersonated[1]. There are certain auditing requirements where the power user performing(impersonating) action on behalf of someone needs to be logged in audit records.
-Ankush

[1]https://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceResolver.html#getUserID()