Showing menu items the user does not have access to

Author Message

Kjell Rune Skaaraas

Friday 15 April 2005 6:23:20 am

I got a site with several sections, some with login required. I want these menu options to be visible even if the user is not logged in (with a lock icon, got that part done). However, when I assign the folders to a different section, they disappear from the menu. If I access it directly, the path (e.g. "ez.no / Community / Forum" is also broken with a "Kernel error (1)".

If I assign "read" access to the anon user, that would give them read permission on all the content. I can build the menu manually but that is annoying. And I'm not at all sure how to fix the path. Anyone know how to fix this?

nga patel

Friday 15 April 2005 6:37:59 am

Hi, Skaaraas
Sorry........
I could not understand your problem very well so let me clear that you have the problem of disappering the menu when you click on the subfolder

so you wnat to set the path related to it????

Right?

Xavier Dutoit

Friday 15 April 2005 6:49:17 am

Hi,

Well, either the user can read or can't. If he doesn't he gets a kernel 1 error when trying to access it. Logical.

What I would suggest is to put these "half visible" items on a special section, and on the view full, display something different based on the group of the user (eg, if he's anonymous, don't display the content but just a "forbidden" message).

That's the same for the menu item, display the lock if he's anonymous.

X+

http://www.sydesy.com

Kjell Rune Skaaraas

Sunday 17 April 2005 11:53:10 pm

Maybe I didn't make this clear enough. I use the default menu template's way of building the menu, which lists all sub-folders, but only those folders the current user has read rights to. I want to show the folders the user does not have access to, but display a login page instead.

So problem #1 is missing menu items (considering just building this manually)

The "content" block does this already ($module_result.content} but the path does not. So I get the login page where the content should be, BUT with a "Kernel error (1)" where the path should be.

So problem #2 is a kernel error on the login page.

If I could do something like this in path.tpl:

"Section show=module.isReadable()"
(...current code)
"Section-else"
Access denied
"Section-end"

That would work just fine, but I can't figure out just how. Right now I think I'll just build the menu manually to add the "missing" links, but I still need to fix the path so that it'll only access the module if the module is readable.

Kjell Rune Skaaraas

Sunday 17 April 2005 11:58:49 pm

Bah, forgot to ask something on #1. Is there a NON-INHERTIABLE read access in eZ? That'd solve my first problem quite elegantly. I've looked but not found it. If the anon user can access the folder properties, but not the contents, that'd be perfect.

James Ward

Wednesday 29 June 2005 2:22:26 pm

Sounds like you need to use the node limitation available in newer version of ez. (can't remember which version it starts in) Just grant the ability to read your non member sections then create a seperate policy to allow read access on only the top level nodes of the members only folders.

working at www.wardnet.com
blogging at www.jamesward.ca

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 31 2025 08:06:24
Script start
Timing: Jan 31 2025 08:06:24
Module start 'layout'
Timing: Jan 31 2025 08:06:24
Module start 'content'
Timing: Jan 31 2025 08:06:24
Module end 'content'
Timing: Jan 31 2025 08:06:24
Script end

Main resources:

Total runtime0.0335 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 588.3750151.2422
Module start 'layout' 0.00860.0039 739.617236.6953
Module start 'content' 0.01240.0193 776.312594.1719
Module end 'content' 0.03170.0017 870.484437.9922
Script end 0.0334  908.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00277.9520140.0002
Check MTime0.00123.5393140.0001
Mysql Total
Database connection0.00092.815310.0009
Mysqli_queries0.005616.651530.0019
Looping result0.00000.044810.0000
Template Total0.00123.510.0012
Template load0.00092.606110.0009
Template processing0.00030.916110.0003
Override
Cache load0.00061.759010.0006
General
dbfile0.008023.936580.0010
String conversion0.00000.023540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs