home contents changes options help subscribe edit (external edit)

When using the zopectl debug prompt to work with a private site, you may need to raise your authentication level (eg to get proper catalog results). Here's how you can become a manager (or any authenticated user) at the beginning of your debug session:

 >>> from AccessControl.SecurityManagement import newSecurityManager
 >>> newSecurityManager(app, PATH.acl_users.getUser(USERNAME)

Or:

 def become(username,context=app):
    from AccessControl.SecurityManagement import newSecurityManager
    newSecurityManager(app, context.acl_users.getUser(username))

 >>> become('user1')
 >>> become('user2',app.mysite)

Question: how do you check your current authentication status ?

See also http://zopelabs.com/cookbook/1091472367 , How to fake REQUEST in debugger



subject:
  ( 23 subscribers )