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.

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 30 2025 16:37:58
Script start
Timing: Jan 30 2025 16:37:58
Module start 'layout'
Timing: Jan 30 2025 16:37:58
Module start 'content'
Timing: Jan 30 2025 16:37:59
Module end 'content'
Timing: Jan 30 2025 16:37:59
Script end

Main resources:

Total runtime0.0357 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 588.3750151.2422
Module start 'layout' 0.00860.0034 739.6172220.7500
Module start 'content' 0.01190.0223 960.36721,006.4766
Module end 'content' 0.03420.0014 1,966.843841.9922
Script end 0.0357  2,008.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00277.6932140.0002
Check MTime0.00123.2465140.0001
Mysql Total
Database connection0.004211.637210.0042
Mysqli_queries0.00195.212930.0006
Looping result0.00000.024710.0000
Template Total0.00102.710.0010
Template load0.00082.099810.0008
Template processing0.00020.571310.0002
Override
Cache load0.00051.403010.0005
General
dbfile0.005214.697580.0007
String conversion0.00000.016740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs