Forums / Setup & design / User management -- limiting access by subtree vs section

User management -- limiting access by subtree vs section

Author Message

David Wirth

Wednesday 14 April 2010 9:43:06 am

Situation: I have a subtree that needs content-read access for the anonymous user; sibling nodes may or may not be publicly accessible; there is a subtree within the subtree that needs to have restricted access (i.e. not readable by anonymous user).

I know this can be done with sections but I have a complication in that there are variable page layouts assigned to sections, and if I add more sections, I need to add more template overrides. This is do-able but it seems inelegant to me.

I was thinking I would instead apply permissions with limitation by subtree but am I correct in understanding that a privilege granted to a subtree applies to all descendant nodes, regardless of restrictions you set at lower levels? That appears to be how it is behaving, as I cannot hide the restricted access descendant node from the anonymous user after giving it read access to the ancestral subtree.

Is there some way to achieve what I'm trying to achieve that will not involve multiple sections and template overrides to keep subsections styled like their parent sections?

Nicolas Pastorino

Friday 16 April 2010 12:58:40 am

Hi David,

How about using section for access limitation (which does not suffer form the same inheritance issue as the subtree limitation does), and relying on url_alias match for the pagelayouts overrides.
References :

  • http://twitter.com/mugo/status/12071558664
  • http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_override_conditions , in the 'pagelayout.tpl' and 'node/view/*.tpl' ( 'url_alias' condition) sections.

Let us know if that works,
Cheers !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

David Wirth

Monday 19 April 2010 6:37:14 am

Oh, does url_alias work for partial matches, e.g. if I specify Match[url_alias]=abc it will apply to abc/def? If that is the case then I'm set. I'll try that out. Thanks.

Peter Keung

Monday 19 April 2010 9:09:37 am

"

Oh, does url_alias work for partial matches, e.g. if I specify Match[url_alias]=abc it will apply to abc/def? If that is the case then I'm set. I'll try that out. Thanks.

"

Yes, we tested that on a 4.2 installation and the Match[url_alias] condition works for partial matches.

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

David Wirth

Tuesday 20 April 2010 6:22:52 am

Thanks, Nicolas and Peter, it works!

Nicolas Pastorino

Tuesday 20 April 2010 6:28:08 am

"

Thanks, Nicolas and Peter, it works!

"

Excellent, good to hear!

You may now want to mark the topic as solved (small ticker by the left of the topic's title above).

Cheers !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

David Wirth

Tuesday 20 April 2010 1:21:13 pm

I clicked it and see a checkmark on this page but it is not showing up on the forum top level.

EDIT: Eh, nevermind, of course it showed up after I posted this.

eZ debug

Timing: Jan 18 2025 02:04:17
Script start
Timing: Jan 18 2025 02:04:17
Module start 'content'
Timing: Jan 18 2025 02:04:18
Module end 'content'
Timing: Jan 18 2025 02:04:18
Script end

Main resources:

Total runtime1.0866 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 590.1172180.8125
Module start 'content' 0.00730.9431 770.9297644.8203
Module end 'content' 0.95040.1361 1,415.7500341.6484
Script end 1.0866  1,757.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3953210.0002
Check MTime0.00160.1453210.0001
Mysql Total
Database connection0.00080.078110.0008
Mysqli_queries0.989491.05452080.0048
Looping result0.00230.21542060.0000
Template Total1.053997.020.5269
Template load0.00230.211120.0011
Template processing1.051696.773420.5258
Template load and register function0.00010.009610.0001
states
state_id_array0.00080.070910.0008
state_identifier_array0.00130.116720.0006
Override
Cache load0.00200.1878400.0001
Sytem overhead
Fetch class attribute can translate value0.00110.099940.0003
Fetch class attribute name0.00130.1218100.0001
XML
Image XML parsing0.00330.306140.0008
class_abstraction
Instantiating content class attribute0.00000.0031140.0000
General
dbfile0.00680.6288400.0002
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
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
2content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs