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

eZ debug

Timing: Jan 18 2025 10:53:05
Script start
Timing: Jan 18 2025 10:53:05
Module start 'content'
Timing: Jan 18 2025 10:53:06
Module end 'content'
Timing: Jan 18 2025 10:53:06
Script end

Main resources:

Total runtime1.1838 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.7031180.8438
Module start 'content' 0.00670.9176 768.5469559.6250
Module end 'content' 0.92440.2594 1,328.1719334.1094
Script end 1.1837  1,662.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3660210.0002
Check MTime0.00150.1274210.0001
Mysql Total
Database connection0.00070.055910.0007
Mysqli_queries1.068190.22402040.0052
Looping result0.00290.24092020.0000
Template Total1.146996.920.5735
Template load0.00200.171020.0010
Template processing1.144996.712720.5724
Template load and register function0.00040.033610.0004
states
state_id_array0.00120.099710.0012
state_identifier_array0.00120.104320.0006
Override
Cache load0.00170.1475240.0001
Sytem overhead
Fetch class attribute can translate value0.00170.139650.0003
Fetch class attribute name0.00160.131350.0003
XML
Image XML parsing0.00080.069050.0002
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.03332.8114210.0016
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0004 secs