[Zope] Testing security in a debug session?

sean.upton@uniontrib.com sean.upton@uniontrib.com
Thu, 27 Feb 2003 15:26:25 -0800


getUser() does not return a user wrapped in the acquistion context of the
user folder (which newSecurityManager() needs), so this code will likely
need the first line changed to:

user = app.acl_users.getUser('foo').__of__(app.acl_users)

Sean

-----Original Message-----
From: Chris McDonough [mailto:chrism@zope.com]
Sent: Thursday, February 27, 2003 3:12 PM
To: Paul Winkler
Cc: zope@zope.org
Subject: Re: [Zope] Testing security in a debug session?


Something like this:

user = app.acl_users.getUser('foo')
from AccessControl.SecurityManagement import newSecurityManager
newSecurityManager(None, user)


On Thu, 2003-02-27 at 17:42, Paul Winkler wrote:
> how do I test as a particular user in a debug session?
> things like has_permission are failing because 
> getSecurityManager().getUser() returns 'Anonymous User'.
> 
> I remember seeing something about how to do this recently, but
> I can't find it for the life of me and i've been looking for
> hours :(
> 
> -- 
> 
> Paul Winkler
> http://www.slinkp.com
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )



_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )