Category Archives for "Plone"

Jul 05

Log in as ‚admin‘ in Plone instance debug console

By Wolfgang Thomas | Allgemein , Plone

You want to use bin/instance debug with administrator’s rights that allows you to view private objects:

>>> from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager
>>> user = app.acl_users.getUser('admin').__of__(app.Plone.acl_users)
>>> newSecurityManager(None, user)
>>> getSecurityManager().getUser()  # just to verify it.
<PropertiedUser 'admin'>

If your instance is called something else than „Plone“, adapt line 2 accordingly.