[Zope-CMF] Strange way to make multiple author and reviewer roles in Zope CMF

Florent Guillaume fg@nuxeo.com
Fri, 21 Feb 2003 20:14:17 +0000 (UTC)


David Cain <dacain@library.syr.edu> wrote:
> If I want to add someone as an author to a folder called bsd/ I simply
> go to local roles under bsd/ and add them as an "owner" role on that
> folder.
> 
> To add someone as a local reviewer (local reviewers cannot see all
> content for review on the portal):
>  o I go to local roles on that folder and add their account with
> "reviewer" role.
>  o I then must go to portal_catalog/ and press Update Catalog.
> 
> To remove a reviewer from that folder:
>  o I go to local roles and add remove their account
>  o I then must go to portal_catalog/ and press Update Catalog.  If they
> had other roles, I must add their account back with those roles.
> 
> Can anyone tell my why this works?  And more importantly, is there an
> easier solution to this?
> 
> I don't feel comfortable updating the catalog.

CMF objects should not be manipulated through the ZMI, otherwise (as you
saw) some CMF invariants (here, the cataloging) are not enforced. The
"legit" way to change local roles in CMF is to do it through the
folder_localrole_form.pt (which is designed only for folders but should
work for all content types I think), or directly call the appropriate
portal_membership methods, see folder_localrole_edit.py.

If you want to do it "by hand", then you'll have to call
ob.reindexObjectSecurity() afterwards, which is what portal_membership
does.

Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com