Re: [xwiki-users] catch error on include macro

2017-03-20 Thread Vincent Massol

> On 20 Mar 2017, at 15:44, Gerritjan Koekkoek  wrote:
> 
> 
> 
> Verstuurd vanaf mijn iPhone
> 
>> Op 20 mrt. 2017 om 13:17 heeft Vincent Massol  het 
>> volgende geschreven:
>> 
>> Hi,
>> 
>>> On 20 Mar 2017, at 13:08, Gerritjan Koekkoek  
>>> wrote:
>>> 
>>> I'm using: {{include document=".yyy"/}} quite a lot.
>>> 
>>> When using it on a page where the current user has not the rights to view I 
>>> get velocity error box!
>>> 
>>> 
>>> Is it possible to give the user some hint instead of the error:
>>> 
>>> 
>>> Like: "To read the complete content of this page you need to login!" with a 
>>> link to Login…
>> 
>> This is not related to logging in or not… It’s related to not having view 
>> rights on the page… You can prevent some users or groups from having view 
>> rights on any page/children even if the user is logged in.
>> 
>> Now if you’re on page that shouldn’t work if the user is not logged in 
>> (because it includes another page for which the user doesn’t have view 
>> rights), then it probably means you have some wrong permissions set for the 
>> current page and it should probably not be viewable by the user.
>> 
> This assumption is not always true. This page has text that can be Viewed by 
> guest and included a page that can/should not be viewed...
> In particular it should work to convince the reading user to consider login 
> or registration and login. The velocity error will probably have the opposite 
> effect…

This is something specific to you and you could implement it using a velocity 
macro and using an #if (and only do the include if the condition is true).

Thanks
-Vincent

> Thanks
>> -Vincent
>> 
>>> Gerritjan Koekkoek
>>> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>>> Visit our website
>>> Facebook
>>> email



Re: [xwiki-users] catch error on include macro

2017-03-20 Thread Gerritjan Koekkoek


Verstuurd vanaf mijn iPhone

> Op 20 mrt. 2017 om 13:17 heeft Vincent Massol  het 
> volgende geschreven:
> 
> Hi,
> 
>> On 20 Mar 2017, at 13:08, Gerritjan Koekkoek  wrote:
>> 
>> I'm using: {{include document=".yyy"/}} quite a lot.
>> 
>> When using it on a page where the current user has not the rights to view I 
>> get velocity error box!
>> 
>> 
>> Is it possible to give the user some hint instead of the error:
>> 
>> 
>> Like: "To read the complete content of this page you need to login!" with a 
>> link to Login…
> 
> This is not related to logging in or not… It’s related to not having view 
> rights on the page… You can prevent some users or groups from having view 
> rights on any page/children even if the user is logged in.
> 
> Now if you’re on page that shouldn’t work if the user is not logged in 
> (because it includes another page for which the user doesn’t have view 
> rights), then it probably means you have some wrong permissions set for the 
> current page and it should probably not be viewable by the user.
> 
This assumption is not always true. This page has text that can be Viewed by 
guest and included a page that can/should not be viewed...
In particular it should work to convince the reading user to consider login or 
registration and login. The velocity error will probably have the opposite 
effect...

> Thanks
> -Vincent
> 
>> Gerritjan Koekkoek
>> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>> Visit our website
>> Facebook
>> email
>> 
>> 
>> 
> 


Re: [xwiki-users] catch error on include macro

2017-03-20 Thread Vincent Massol
Hi,

> On 20 Mar 2017, at 13:08, Gerritjan Koekkoek  wrote:
> 
> I'm using: {{include document=".yyy"/}} quite a lot.
> 
> When using it on a page where the current user has not the rights to view I 
> get velocity error box!
> 
> 
> Is it possible to give the user some hint instead of the error:
> 
> 
> Like: "To read the complete content of this page you need to login!" with a 
> link to Login…

This is not related to logging in or not… It’s related to not having view 
rights on the page… You can prevent some users or groups from having view 
rights on any page/children even if the user is logged in.

Now if you’re on page that shouldn’t work if the user is not logged in (because 
it includes another page for which the user doesn’t have view rights), then it 
probably means you have some wrong permissions set for the current page and it 
should probably not be viewable by the user.

Thanks
-Vincent

> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website
> Facebook
> email
> 
> 
> 



[xwiki-users] catch error on include macro

2017-03-20 Thread Gerritjan Koekkoek
I'm using: {{include document=".yyy"/}} quite a lot.

When using it on a page where the current user has not the rights to view I get 
velocity error box!


Is it possible to give the user some hint instead of the error:


Like: "To read the complete content of this page you need to login!" with a 
link to Login...


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website
Facebook
email