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

Carl Rendell cer@sol43.com
Tue, 1 Oct 2002 23:51:21 -0700


Just an FYI.. I thought that this script was handling the problem, 
but I'm still seeing issues with folders and workflow. If anyone 
has anything to add. I'm sure Chris and I would appreciate it.

~C

On Tuesday, October 1, 2002, at 09:01  AM, Carl Rendell wrote:

> After some additional testing. This modified content_status_modify 
> script seems to do the trick on preventing anonymous users from 
> accessing unpublished or not effective content within a folderish 
> object that is published. Chris and others may want to do more 
> testing as well.
>
> BTW, I was having some difficulty getting this to work until I 
> reindexed the catalog.
>
> My final version of the content_status_modify script takes care of 
> the reindexing of sub objects, and the '/view' issue.
>
> ## Script (Python) "content_status_modify"
> ##parameters=workflow_action, comment=''
> ##title=Modify the status of a content object
>
> context.portal_workflow.doActionFor(
>     context,
>     workflow_action,
>     comment=comment)
>
> view = '/view'
>
> # added to allow for workflow controlled folders
> if context.isPrincipiaFolderish:
> 	view = ''
> 	context.reindexObjectSecurity()
>
> if workflow_action == 'reject':
> 	redirect_url = context.portal_url() + '/search?review_state=pending'
> else:
> 	redirect_url = '%s%s?%s' % ( context.absolute_url()
> 		                       , view
> 		                       , 'portal_status_message=Status+changed.'
> 		                       )
>
> context.REQUEST[ 'RESPONSE' ].redirect( redirect_url )
>
>

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