Forums / Setup & design / Showing menu items the user does not have access to

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