Forums / Setup & design / HowTo protect folders

HowTo protect folders

Author Message

John van der Boom

Wednesday 13 August 2003 6:42:58 pm

Imagine I have a folder with articles in it, but I dont want people to go on that particular folder, by changing the node_id of the articles into the node_id of that folder.

How can I do this with eZ? Is there a way to make certain nodes "invisible" for people that don't have enough rights?

Bjørn Kaarstein

Thursday 14 August 2003 12:50:38 am

I suppose you can assign this folder of yours to its own section, and create a user/group that have the rights to view this section.
If you don't give these rights to the anonymous user, your section won't be available until you're logged in.

Regards Bjørn

Sander Jansen

Thursday 14 August 2003 1:08:38 am

I guess there are many ways to accomplish this, but here's what I would do: duplicate the folder class and name it for example hidden_folder... and then edit your roles and give proper permissions to the ones that _should_ be able to view the folder.

An other way to do it is to add an override to an error page ;-)

Tristan Koen

Thursday 14 August 2003 2:15:07 am

Another approach you could consider is to put the logic to control this into your template. This keeps the admin side of things simple.
The drawback is (of course) that the roles applicable to your exclusion are hard-coded into the template (the role can be assigned as usual through the admin pages though).

Try something like this:

{section show=fetch(user,current_user).roles.id|contains,array(id's to exclude)}
...
{section-else}
...
{/section}

John van der Boom

Thursday 14 August 2003 7:01:29 am

Thank your for your reply. I appreciate it.
I think I'm gonna try the solution of Sander with that error page thing. It sounds nice. :)