[Zope-CMF] WorkFlow / Security advice

Florent Guillaume fg at nuxeo.com
Thu Mar 10 14:37:31 EST 2005


Dieter Maurer wrote:
> Florent Guillaume wrote at 2005-3-10 12:55 +0100:
> 
>>...
>>   newSecurityManager(None, tmp_user)
>>   ### CALL YOUR METHOD HERE ###
>>finally:
>>   newSecurityManager(None, user)
> 
> 
> Be warned that "newSecurityManager" kills your execution context.
> You will loose any proxy roles...
> 
> The better way is to use:
> 
>     old_sm = getSecurityManager()
>     newSecurityManager(None, tmp_user)
>     ...
>     setSecurityManager(old_sm)
> 
> "setSecurityManager" is defined in "AccessControl.SecurityManagement".

Thanks, I'll keep that in mind and change our code (even though in the 
cases where I use this we don't have proxy roles, I think).

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-CMF mailing list