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.

eZ debug

Timing: Jan 18 2025 20:56:12
Script start
Timing: Jan 18 2025 20:56:12
Module start 'layout'
Timing: Jan 18 2025 20:56:12
Module start 'content'
Timing: Jan 18 2025 20:56:13
Module end 'content'
Timing: Jan 18 2025 20:56:13
Script end

Main resources:

Total runtime0.7169 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1719152.6406
Module start 'layout' 0.00600.0035 741.812539.4922
Module start 'content' 0.00950.7057 781.3047589.9531
Module end 'content' 0.71530.0015 1,371.257812.1250
Script end 0.7168  1,383.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4492160.0002
Check MTime0.00130.1821160.0001
Mysql Total
Database connection0.00090.124710.0009
Mysqli_queries0.662692.4335620.0107
Looping result0.00060.0897600.0000
Template Total0.678494.620.3392
Template load0.00240.335120.0012
Template processing0.676094.296920.3380
Template load and register function0.00020.031810.0002
states
state_id_array0.00090.126910.0009
state_identifier_array0.00260.367620.0013
Override
Cache load0.00200.2759230.0001
Sytem overhead
Fetch class attribute can translate value0.00090.129230.0003
Fetch class attribute name0.00110.149660.0002
XML
Image XML parsing0.00100.144030.0003
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00100.1376220.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs