You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Guillaume Lucazeau <gl...@gmail.com> on 2016/05/02 17:00:00 UTC

Re: Use of request/resource wrappers

Hello,

I thought I could use different views. For instance for a page resource, I
could have presentation.html.jsp, read-only.html.jsp and html.jsp. To use
the presentation view it's all good I cn hard code it in my link has it's
the user that will manually request this view. However, for the read-only
view, it depends on the document status. If it's locked or if the user has
no write privileges, this view should be rendered.

I was thinking to implement a filter that would check these two conditions,
and dynamically add the "read-only" selector to the request if the user is
not allowed to edit the resource.

However, I did not find a way to add a selector to a request using the
Sling API, is it possible somehow to update RequestPathInfo? Like the
"replaceSelectors" parameter of the sling:include tag but in Java code. is
that possible?

Thank you for your help!

Kind regards,
Guillaume

On Wed, Apr 27, 2016 at 4:05 PM, Guillaume Lucazeau <gl...@gmail.com>
wrote:

> Hello Bertrand,
>
> Unfortunately I cannot, we don't support anonymous access because from the
> user account depends what "documents" he can see and sometimes edit.
>
> On Wed, Apr 27, 2016 at 4:00 PM, Bertrand Delacretaz <
> bdelacretaz@apache.org> wrote:
>
>> Hi,
>>
>> On Wed, Apr 27, 2016 at 11:16 AM, Guillaume Lucazeau
>> <gl...@gmail.com> wrote:
>> > ...My application is supposed to have a "presentation mode" that
>> disables
>> > editing capabilities on content....
>>
>> Can't you use access control for that?
>>
>> For example give read only access to the anonymous user and read/write
>> to logged in content authors.
>>
>> -Bertrand
>>
>
>

Re: Use of request/resource wrappers

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Monday 02 May 2016 17:00:00 Guillaume Lucazeau wrote:
> Hello,

Hi Guillaume,
 
> I thought I could use different views. For instance for a page resource, I
> could have presentation.html.jsp, read-only.html.jsp and html.jsp. To use
> the presentation view it's all good I cn hard code it in my link has it's
> the user that will manually request this view. However, for the read-only
> view, it depends on the document status. If it's locked or if the user has
> no write privileges, this view should be rendered.
> 
> I was thinking to implement a filter that would check these two conditions,
> and dynamically add the "read-only" selector to the request if the user is
> not allowed to edit the resource.
> 
> However, I did not find a way to add a selector to a request using the
> Sling API, is it possible somehow to update RequestPathInfo? Like the
> "replaceSelectors" parameter of the sling:include tag but in Java code. is
> that possible?

sure, see FormServlet in samples/fling. It adds a selector on success and 
forwards the request.

Regards,
O.

> Thank you for your help!
> 
> Kind regards,
> Guillaume
[...]


Re: Use of request/resource wrappers

Posted by vkum14 <vk...@sapient.com>.
Or even simpler, let your application has a landing jsp which will have this
business logic of adding selector using sling:include. We have used this and
working properly.



--
View this message in context: http://apache-sling.73963.n3.nabble.com/Use-of-request-resource-wrappers-tp4061096p4062540.html
Sent from the Sling - Users mailing list archive at Nabble.com.