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. :)

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 18 2025 16:27:03
Script start
Timing: Jan 18 2025 16:27:03
Module start 'layout'
Timing: Jan 18 2025 16:27:03
Module start 'content'
Timing: Jan 18 2025 16:27:03
Module end 'content'
Timing: Jan 18 2025 16:27:03
Script end

Main resources:

Total runtime0.7181 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.9063152.6250
Module start 'layout' 0.00530.0032 740.531339.4453
Module start 'content' 0.00850.7082 779.9766554.5469
Module end 'content' 0.71670.0013 1,334.523412.4844
Script end 0.7181  1,347.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5416160.0002
Check MTime0.00130.1766160.0001
Mysql Total
Database connection0.00090.121210.0009
Mysqli_queries0.666392.7823670.0099
Looping result0.00070.0974650.0000
Template Total0.680494.720.3402
Template load0.00360.501920.0018
Template processing0.676794.243320.3384
Template load and register function0.00020.034010.0002
states
state_id_array0.00160.226610.0016
state_identifier_array0.00200.277720.0010
Override
Cache load0.00320.4509240.0001
Sytem overhead
Fetch class attribute can translate value0.00100.145140.0003
Fetch class attribute name0.00180.247150.0004
XML
Image XML parsing0.00050.070640.0001
class_abstraction
Instantiating content class attribute0.00000.001950.0000
General
dbfile0.00070.1024100.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs