[Product-Developers] Content-type schemata edit permissions
Hedley Roos
hedleyroos at gmail.com
Sat Feb 14 08:05:25 UTC 2009
> I have a content-type with few widgets separated in two shematas (BASIC_INFO
> and ADDITIONAL_INFO). I have two groups of editors, one with the role
> BASIC_EDITOR and other ADDITIONAL_EDITOR. Both groups of editors have the
> permission to add and edit this content-type, but group with role
> BASIC_EDITOR must be able to see and edit only BASIC_INFO and the role
> ADDITIONAL_EDITOR only ADDITIONAL_INFO. So one content-type, two schematas
> and two editors for each schemata.
>
> Is this possible and what is better sollution?
This is definitely possible. You must make use of the write_permission
and read_permission settings for fields. This means that you need two
new permissions tied to your roles, eg.
Role BASIC_EDITOR has permission "Manage basic fields", and role
ADDITIONAL has permission "Manage additional fields". You'll need to
do a portal.manage_permission('Manage basic fields', roles=['Manager',
'BASIC_EDITOR'], acquire=True) in a setuphandler or the like. Do
something similar for "Manage additional fields".
Then you declare your fields like
StringField(
name='my_basic_field',
read_permission='Manage basic fields',
write_permission='Manage basic fields',
widget=StringWidget(),
)
That should do it.
Hedley
More information about the Product-Developers
mailing list