Hi ,
I wanted to know what happens when we pass "null" to "getAdministrativeResourceResolver" function in "org.apache.sling.api.resource.ResourceResolverFactory"?
Does it tries to give administrative privileges based on the current loggedin user's profile or based on something else. Also does this work if we have implemented SSO for AEM?
Edit: forgot to add that I get the ResourceResolverFactory using
@Reference private ResourceResolverFactory resolverFactory;
;
thanks,
Kevin
Solved! Go to Solution.
Views
Replies
Total Likes
As dgordon86 pointed out - this is deprecated in AEM 6. See this AEM community article that steps you through using the Sling getServiceResourceResolver method:
http://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html
Views
Replies
Total Likes
Correct, it returns admin. See https://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceResolverFactory.html#g...).
We have community articles that show using this API in an OSGI. See http://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html.
Views
Replies
Total Likes
So if we always pass null then under what circumstance can it fail ?(if it can that is)
thanks again .
kevin
Views
Replies
Total Likes
I have never seen a fail on many OSGi bundles that we run. I have always passed null as per the Javadocs.
Views
Replies
Total Likes
In AEM 6.0 the method getAdministrativeResourceResolver has been deprecated [0], as it is considered a security risk by providing too broad of access. A best practice is now to create a Service User with only the necessary permissions and use the method getServiceResourceResolver to get a ResourceResolver. There is a full discussion on the Sling documentation: [1]. In addition Yogesh Upadhyay provides a good tutorial on his blog: [2]
[1] - http://sling.apache.org/documentation/the-sling-engine/service-authentication.html
[2] - http://www.wemblog.com/2014/08/how-to-use-sessions-and-resource.html
Views
Replies
Total Likes
As dgordon86 pointed out - this is deprecated in AEM 6. See this AEM community article that steps you through using the Sling getServiceResourceResolver method:
http://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies