[Zope-CMF] portal_workflow.doActionFor - Unauthorized error

Tres Seaver tseaver@zope.com
Tue, 04 Sep 2001 07:26:08 -0400


Gitte Wange wrote:

> Hello,
> 
> I need to change the status of some objects programmatically (when people 
> upload a file I need the object to be submitted for reviewing).
> 
> I know this has been discussed earlier on this list (and thanks to Tres for 
> "enlighten" me *S*).
> My code looks like this:
> <dtml-let masterfileid="id + '_MasterFile'"
> 	   obj="restrictedTraverse(masterfileid)">
>   <dtml-call "obj.editFile(REQUEST['file'])">
>   <dtml-call "portal_workflow.doActionFor(obj, 'publish')">
>   <dtml-call "REQUEST.set('status_message', 'Masterfile uploaded')">
> </dtml-let>
> But I get an unathorized error when I call the upload method as Member.
> So ... what permission settings must I set in order for Members to "submit" 
> objects for reviewing programatically ???


Your code tries to 'publish', rather than 'submit', the file;

you need 'doActionFor( obj, "submit" )'.


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com