Expand my Community achievements bar.

SOLVED

Resource resolver

Avatar

Level 4

Does the resource resolver object which we get from a resource or request object in a sling model has all JCR privileges(read, write, modify etc...) ??

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Prashanth_02a,

Getting resource resolver object from request/resource will have set of permissions that depend on user session that is correlated with it, e.g if anonymous user will request for specific resource, in your code for given scenario, getting resource resolver object from request will return you resource resolver with anonymous user set of privileges.

In other words set of permissions is not guarantee if you getting resource resolver object from request/resource.

If you always need specific set of permissions, you should create resource resolver object using service user. You can find more about this approach under:

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Prashanth_02a,

Getting resource resolver object from request/resource will have set of permissions that depend on user session that is correlated with it, e.g if anonymous user will request for specific resource, in your code for given scenario, getting resource resolver object from request will return you resource resolver with anonymous user set of privileges.

In other words set of permissions is not guarantee if you getting resource resolver object from request/resource.

If you always need specific set of permissions, you should create resource resolver object using service user. You can find more about this approach under: