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.