[Zope-CMF] Right way to do Edit in Python product?
Tres Seaver
tseaver@zope.com
Tue, 23 Apr 2002 08:20:45 -0400
Jon Edwards wrote:
> Looking through CMF Default (CMF 1.2), there seems to be two different ways
> Edit is handled in different modules. Can anyone tell me which is the right
> way, or best practice?
> -------------------------------------------------------------
> 1. e.g. File.py
>
> def edit(.....):
> Do editing stuff
> edit = WorkflowAction(edit)
> -------------------------------------------------------------------
> 2. e.g. Link.py
>
> security.declarePrivate( '_edit' )
> def _edit( self, remote_url ):
> Do editing stuff
>
> security.declareProtected( CMFCorePermissions.ModifyPortalContent, 'edit' )
> edit = WorkflowAction( _edit )
> --------------------------------------------------------------------
>
> I'm guessing that method 2 would be better, as it includes security
> declarations?
Right. CMFDefault/File contains some fossilized code: the security assertions
are in '__ac_permissions__' of the class, instead of being declared via a
ClassSecurityInfo instance.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com