Forums / General / Question about Object States

Question about Object States

Author Message

Jeremy B.

Thursday 25 June 2009 3:24:42 pm

Hi all,

I'm wondering if I could use object states to restrict access for some folders in the admin menu.

Considering a use role "editor", that can read/create/modify/delete all the content under the root folder (gracefully to the section attribute). Root folder contains 2 folders, let's say :

-Root
--- News - Assigned section : "news"
--- Products - Assigned section : "products"

For the container "products", I would like to restrict access for the user role just for this container.
The editor could read/create/modify/delete products item children, but I don't want him to modify the "products" container.

Should object states help me to do this ?
I was thinking that the "ez_lock" default state would allow me to do this, but I can't even assign this state to an object. Is that as expected ?

Thanks for your help :)

Gaetano Giunta

Friday 26 June 2009 1:29:51 am

I do not think you need object states for this, plain permission system should be enough.
You could either:
- use a 3rd section, assigned to the products node and not its children, eg. "products-folder", and give user the permission to edit content in section products but not products-folder
- limit the editing permission for users on the products section with a depth > 1 rule

Principal Consultant International Business
Member of the Community Project Board

Jeremy B.

Tuesday 30 June 2009 1:06:40 am

Thanks for your answer Gaetano :)

Yes, I was thinking at first that I could use Section. But I though that the use of a section on a folder will automaticaly assign these section to its children.

How can I tell eZ to not do that ? I mean, just assign a section to a parent folder like you said ? Furthermore, how the third section will be automatically assigned to the children ?

Thanks for your help

Gaetano Giunta

Tuesday 30 June 2009 1:53:34 am

The hard way is to assign section to parent and then change it back again on all children (take care: new children will by default get the new one).

Principal Consultant International Business
Member of the Community Project Board

Jeremy B.

Tuesday 30 June 2009 2:02:23 am

Ok, thank you very much :)