[Product-Developers] Content type with fields with different permissions for different roles.

mnieper marc at nieper-wisskirchen.de
Sun Mar 30 14:07:08 UTC 2008

I want to develop an Archetype content type with, say, three fields called
Private, Semi-Private and Public. The owner of the content object should
have view and modify permissions for all three fields. Anonymous users
should have only view access for the Public field. Furthermore, I want to
have a role, say "Restricted User", which grants view and modify permissions
for the Semi-Private and the Public field.

My question is how to do achieve this in a canonical way. Two possible
solutions have come to my mind:

1) Create three AT content types. The first one includes the Private field
and two references to content objects of the other two content types. These
other two content types are simply wrappers around the Public and the
Semi-Private field. Then I can use the standard permissions (zope2.View,
cmf.ModifyPortalContent) on the three content objects in order to achieve
what I want.

2) Create one AT content type that implements three Zope 3-schemata, say
IPublicSchema, IPrivateSchema and ISemiPrivateSchema. Create four new
permissions, say View Private Content, View SemiPrivate Content, Modify
Private Content and Modify SemiPrivate Content. 
Then use configure.zcml and the <require /> tag to link these four new
permissions to the two fields Private and SemiPrivate. Finally grant the
Owner and the Restricted User (some of) the new permissions.

What is the best way to solve the problem? (I am developing with Plone 3.1.)
Or is there a better way?


Marc Nieper-Wißkirchen
View this message in context: http://www.nabble.com/Content-type-with-fields-with-different-permissions-for-different-roles.-tp16381907s20094p16381907.html
Sent from the Product Developers mailing list archive at Nabble.com.

More information about the Product-Developers mailing list