[Zope-CMF] trivial new portal folder type gives weird workflow/security behavior?

Carl Rendell cer@sol43.com
Sun, 29 Sep 2002 15:08:39 -0700


On Sunday, September 29, 2002, at 08:36  AM, zope-cmf-
request@zope.org wrote:

> Message: 13
> Subject: Re: [Zope-CMF] trivial new portal folder type gives weird
> 	workflow/security behavior?
> From: Florent Guillaume <fg@nuxeo.com>
> To: chris@palefish.co.uk
> Cc: zope-cmf <zope-cmf@zope.org>
> Date: 29 Sep 2002 17:31:06 +0200
>
> Well the standard content_status_modify doesn't take into account the
> possibility of workflowed folders. It probably should, so yes please
> fill a Collector issue to remind us.
>
> There are two things to take into account: the redirect (don't append
> /view for a folder) (the error you got in step 8), and the 
> reindexing of
> children to have their security correcly interpreted in the catalog
> (call reindexObjectSecurity) (the visibility errors you had).
>

I've been working with the same sort of issues, and have tried 
adding context.reindexObjectSecurity() within my modifications to 
content_status_modify, but it does not seem to have the desired 
effect -

Modified code:

context.portal_workflow.doActionFor(
     context,
     workflow_action,
     comment=comment)

if workflow_action == 'reject':
	redirect_url = context.portal_url() + '/search?review_state=pending'
         if context.isPricipiaFolderish:
                 context.reindexObjectSecurity()
else:
	if context.isPrincipiaFolderish:
                 context.reindexObjectSecurity()
		redirect_url = '%s?%s' % ( context.absolute_url()
                                   , 
'portal_status_message=Status+changed.'
                                   )
	else:
		redirect_url = '%s/view?%s' % ( context.absolute_url()
		                              , 
'portal_status_message=Status+changed.'
		                              )

context.REQUEST[ 'RESPONSE' ].redirect( redirect_url )

reindexObjectSecurity() - in CMFCore.CatalogAware - appears to 
recurse through all object within the given context by doing a 
catalog search, but it does not seem to be changing the security 
context.

Have I implemented this correctly?

~C

Carl E. Rendell
Solution43
Information Distribution Consulting        |   "Ahhhh the power of
cer@sol43.com                              |    acquisition"  - Chef Z