force login for a section

Author Message

Lydie Soler

Friday 29 July 2005 9:28:59 am

I have created a section intranet. I want to force anonymous user to log in but only for this section.

How can I do this?

Thanks for your help

Arran Price

Monday 01 August 2005 2:21:52 pm

Hi Lydie,
Create a new section from the admin interface and assign it to the node you want. Then go and check the role for the anonymous users and make sure they dont have access to it. By default if a user (including anonymous users) dont have access to anything they will be prompted with a login screen.

Arran

Lydie Soler

Tuesday 02 August 2005 2:00:30 am

Thanks for your answer. But if I do that, the node associated with the section doesn't appear anymore in my menu....
Why?.... I suppose it is because the anonymous doesn't have access to it...
How can I make it appear?
THanks for your help

David Eriksson

Tuesday 02 August 2005 2:06:08 am

Edit the permissions of Anonymous, adding the right to read objects of your new section.

/David

Lydie Soler

Tuesday 02 August 2005 2:14:00 am

I add the folowwing policy:
content read Section( Intranet )

I can see it in the menu, but it doesn't ask for login (which seems quite correct for me as I just add the right to read the content....)
So I suppose I didn't add the right policy. Can you be more precise on the policy I need to add?
Thanks

David Eriksson

Tuesday 02 August 2005 2:58:44 am

Hmm, sorry, I didn't read your original post well enough it seems. :)

I'm not sure how to solve this really. I guess one solution might be to add links to the menu, thus getting an object that shows up in the menu and when clicked on leads to the hidden object, prompting a login. You'd have to add a new link for every new hidden object you'd like to appear in the menu though...

/David

Arran Price

Tuesday 02 August 2005 4:21:41 pm

the issue is, theres no way to force a login, if the user can already see the conent (theres simply no point).

So as David mentions, you need to do something like add a link to that content so that it appears in your menu.

If you put all your restricted content in a new folder, then its only that folder you need to add a link to, call it members area or something like that perhaps.

The next hitch I guess is that once you are logged in, the menu will show both the link and the restricted folder. You will need to edit the menu template (if you are using one of the default ones) to get that to work I think OR copy the folder class, and use that for your new folder the reason for doing this is that unless you put it in the appropriate settings file, the new class wont show up in the menu (I opt for the new class).

hope thats of some help

Arran

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.