Forums / Setup & design / Protecting content based on age

Protecting content based on age

Author Message

Nathan Sharp

Wednesday 21 February 2007 5:34:42 pm

I have the desire to have a section of my eZp site protected based on age. Basically I'd like anonymous access for 30 days, or some configurable amount, then have the content automatically become available only for registered users. Is there any provisions for this, or can anyone think of any good ways for me to implement it?

Kristof Coomans

Wednesday 21 February 2007 11:19:43 pm

Hi Nathan

Concerning the timed anonymous access: this is quite difficult to accomplish, or even impossible. There's no way you can really make this work as far as I know (cookies can be removed, IP address can be the same for different users because a proxy is used).

The protection based on age should be a little bit easier. You can add an age selection box in the user account and then use the automated user placement extension to put the different ages in different user groups (to which different policies are assigned): http://ez.no/community/contribs/workflow/automated_user_placement_for_ez_publish_3_8

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nathan Sharp

Thursday 22 February 2007 3:47:19 am

Thanks so much for the reply! When I said "age", I meant solely the age of the article, not of my users :-) So I guess I'll keep on looking.

Thanks!
Nathan

Kristof Coomans

Thursday 22 February 2007 4:13:29 am

Hi Nathan

So I was thinking too far :-)

Maybe you can write a custom cronjob that changes the section of an article (to a section the anonymous user has read access on) once it is old enough to be released to everyone?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org