Trouble displaying protected content on the homepage

Author Message

Chuck McCormick

Friday 10 August 2007 1:10:31 pm

Hi, I'm a new ezpublish user, and I'm having the following difficulty. I have a business rule that anonymous users should be able to see the articles displayed on my homepage, but they should not be able to drill down into the content in the tree below the homepage, while registered members can. In my content tree under the homepage, I have several different directories that are restricted to my members group.

What I would like to do is embed the most recent article from each of my restricted directories into the home page, kind of like a teaser for non-registered users, and they should be able to read those articles. However, whenever I embed one of the articles from lower down in the tree (below the anonymous user threshold), and then I try to go to my homepage as an anonymous user, I get a block of text where the article should be saying that I don't have access to it. It seems like a relatively common thing to want to do, but I cannot find any other posts about it anywhere. Does anyone have any idea how I could accomplish this?

Tony Wood

Saturday 11 August 2007 2:53:12 am

Hi Chuck,

You have a few options that might aid you here:

1. Copy the articles you want on the homepage folder and use this and give anon access
2. Add an alternative location and give anon access to the alternative location
3. Set anon read access to the nodes you want on the home page (a bit of an overhead this one)
4. Code the fetch to use an anon override so you can retrive any article whatever the access right. (Use carefully as i could break badly, but you will be testing so will be ok)
5. Make the homepage area a XML text field so you can enter content into it ( a bit lame this one)

Good luck..

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Xavier Dutoit

Saturday 11 August 2007 11:16:14 am

Hi,

The easiest is usually to do a fetch while ignoring the access rules that's the 'limitation' parameter ( array() simply display all content, ) otherwise magic Kristof developed an extension to get the same access rights as user you define.

X+

http://www.sydesy.com

Chuck McCormick

Monday 13 August 2007 6:57:49 am

Thanks for the suggestions, guys. I'll let you know how it works.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.