Logging in under the Zope/Plone debugger
Posted at 1:15pm on Monday, January 9th, 2006A very dull but very useful post if you’re trying to use zopectl debug and need to authenticate (to add test content or change workflow states, for example). Deep in the comments on this page is the following anonymous comment which should be typed at the debugger prompt:
# replace 'admin' with the desired user id
>>> from AccessControl.SecurityManagement \\
... import newSecurityManager
>>> user = app.portal.acl_users.getUserById('admin')
>>> user = user.__of__(app.portal.acl_users)
>>> newSecurityManager(None, user)