Executing restricted code as a different user in plone

Restricted code executing under a different user id from a browser view in plone

I want to run some tests on a live site (e.g. to test configurations, user problems that only seem to appear on the live site, etc.). For this I have a browser view, that is typacally called by an admin user. But some problems have to do with security, and I want to test under a different user id. Also, code in browser views normally is unrestricted, so security doesn't really apply.

#variable set in the code are in the returned dict, including printresult return globals

This would be used like this:

code = """

site.manage_changeProperties(title='foobar')

print site.title

x = 1

"""

output = callAsUser(site,'SomeUser',code)

output['x'] == 1
output['printed'] == 'foobar\n'

Esther
says:

Mar 22, 2015 05:26 AM

As a business owner, this presents a couple of options. Then, once published, promote them through your social media outlets to widen your audience. Whether you know it or not, there are a lot of different channels that you can explore to get more market share, but that doesn't come without a little bit of work.

Aufdecken klare Programme von SEO UNTERNEHMEN
says:

Mar 22, 2015 05:26 AM

As a business owner, this presents a couple of options. Then, once published, promote them through your social media outlets to widen your audience. Whether you know it or not, there are a lot of different channels that you can explore to get more market share, but that doesn't come without a little bit of work.

Add comment

You can add a comment by filling out the form below. Plain text formatting.