Created
February 27, 2012 10:29
-
-
Save jone/1923002 to your computer and use it in GitHub Desktop.
bin/instance run setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from AccessControl.SecurityManagement import newSecurityManager | |
from Testing.makerequest import makerequest | |
from zope.app.component.hooks import setSite | |
site_name = 'Plone' | |
# setup request and get plone site | |
app = makerequest(app) | |
site = app.unrestrictedTraverse(site_name) | |
# setup user context | |
user = site.acl_users.getUser(site.getWrappedOwner()) | |
user = user.__of__(app.acl_users) | |
newSecurityManager(app, user) | |
#setup site | |
setSite(site) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment