Forums / Setup & design / Problems with showing menu item based on rol...

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.

 

eZ debug

Timing: Jan 18 2025 22:33:59
Script start
Timing: Jan 18 2025 22:33:59
Module start 'content'
Timing: Jan 18 2025 22:34:00
Module end 'content'
Timing: Jan 18 2025 22:34:00
Script end

Main resources:

Total runtime1.3786 sec
Peak memory usage4,096.0000 KB
Database Queries213

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 589.4453180.8125
Module start 'content' 0.00761.2028 770.2578621.0625
Module end 'content' 1.21030.1682 1,391.3203337.1563
Script end 1.3785  1,728.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3121210.0002
Check MTime0.00160.1160210.0001
Mysql Total
Database connection0.00080.059010.0008
Mysqli_queries1.297094.08172130.0061
Looping result0.00220.16292110.0000
Template Total1.338497.120.6692
Template load0.00240.172920.0012
Template processing1.336096.909020.6680
Template load and register function0.00020.012710.0002
states
state_id_array0.00090.063910.0009
state_identifier_array0.00160.118720.0008
Override
Cache load0.00200.1419430.0000
Sytem overhead
Fetch class attribute can translate value0.00170.122750.0003
Fetch class attribute name0.00180.129980.0002
XML
Image XML parsing0.00080.055150.0002
class_abstraction
Instantiating content class attribute0.00000.001080.0000
General
dbfile0.00210.1493210.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs