Problems with showing menu item based on rol...

Author Message

Richard Francken

Monday 21 February 2005 4:40:26 am

Hi,

I have create two groups (members and visitors). I have create two sections (members and visitors). I have create two rolls (members and visitors). On the top level I have create a folder (section) called members with the roll members. All other content is for everyone.

OK. When I visit the first time the site the menu item is not available. That's OK. But after a login as a member the menuitem is still not available. After cleaning the cache the menuitem will be visible, but are you a visitor the menu item is still there.

How do I fixed that.

richard.

Nathan Mann

Wednesday 23 February 2005 8:30:03 am

Does anyone have any input on this? I am having the exact same issue with 3.5.0.

I have some of the sub-folders of the main folder assigned to a "members only" section to prevent anonymous users from accessing them. That part works fine.

However, when I log in as a user, I can not see the "members only" sub-folders until I go into one of the other sub-folders, at which point I can now see all of the folders I should be seeing. As soon as I go back up to the top-level folder, the protected folders dissapear again.

Does anyone have any suggestions?

-nathan

Gabriel Ambuehl

Wednesday 23 February 2005 8:49:48 am

That's probably a cache problem. Try surrounding it with a cache block whose key includes the role or something like that, so that there are two different versions based on the role id.

Visit http://triligon.org

Nathan Mann

Wednesday 23 February 2005 9:08:38 am

Gabriel, thanks for the quick response. I had also suspected a problem with the cache, but am not familiar with the cache manipulation directives.

I am searching through the documentation and forums for more information regarding how to do what you suggested. Any pointers/info you might have to offer would be greatly appreciated.

Thanks again,

-nathan

Nathan Mann

Wednesday 23 February 2005 10:04:00 am

OK, I found the info that I needed to implement Gabriel's suggestion.

For anyone that is interested:

1. Create an override for pagelayout.tpl and copy the original contents to the override.
2. Find the cache blocks for all of the menus
3. To each cache block change the keys to the following:
keys=array('my_cache_block',$uri_string,$current_user.role_id_list|implode(',')) expiry=86400

There may be a better way to do this, but I needed a quick fix and this worked. Any suggestions on improvements would be appreciated.

Thanks again Gabriel for the pointer.

-nathan

Gabriel Ambuehl

Wednesday 23 February 2005 10:51:44 am

Hey, it was more like a wild guess. But thanks for testing that, I might run into that myself some day ;-)

Visit http://triligon.org

Richard Francken

Monday 28 February 2005 1:01:01 pm

Hi Nathan and Gabriel,

Thanks for your help. The quick solution works fine. So I'm happy.

Richard

fabio bongiovanni

Thursday 15 September 2005 8:23:37 am

Hello

I?m using ez 3.6.1.
I've tried the work-around, but on my installation
it doesn't work, always the cached copy is used.

 

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 16:06:16
Script start
Timing: Jan 18 2025 16:06:16
Module start 'layout'
Timing: Jan 18 2025 16:06:16
Module start 'content'
Timing: Jan 18 2025 16:06:17
Module end 'content'
Timing: Jan 18 2025 16:06:17
Script end

Main resources:

Total runtime0.9351 sec
Peak memory usage4,096.0000 KB
Database Queries76

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.1641152.6406
Module start 'layout' 0.00570.0032 741.804739.4766
Module start 'content' 0.00890.9245 781.2813615.9688
Module end 'content' 0.93340.0017 1,397.250016.1250
Script end 0.9351  1,413.3750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3445160.0002
Check MTime0.00150.1604160.0001
Mysql Total
Database connection0.00070.074810.0007
Mysqli_queries0.877693.8449760.0115
Looping result0.00080.0853740.0000
Template Total0.903696.620.4518
Template load0.00230.247220.0012
Template processing0.901396.384220.4507
Template load and register function0.00030.028410.0003
states
state_id_array0.00120.124710.0012
state_identifier_array0.00150.156820.0007
Override
Cache load0.00200.2151430.0000
Sytem overhead
Fetch class attribute can translate value0.00080.090840.0002
Fetch class attribute name0.00140.154780.0002
XML
Image XML parsing0.00040.047040.0001
class_abstraction
Instantiating content class attribute0.00000.001680.0000
General
dbfile0.00060.0609100.0001
String conversion0.00000.001040.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 22
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs