unrestrictedGetObject()

unrestrictedGetObject()

Posted by Nejc Zupan at Dec 15, 2009 12:00 AM |
Filed under: ,

Argh! Sometimes I am truly amazed by how much I can complicate things.

For the past year or so, every time I had to access an object with brain.getObject() that I otherwise did not have permission to, I went to great lengths hacking Zope's SecurityManager to let me do it.

Today, I was introducted to unrestrictedGetObject(). I have kind of expected that it should exist, but I've always looked in the wrong place. It's dead-easy to use:

brain._unrestrictedGetObject()

Hopefully this spares someone some frustration.

Powered by DISQUS comment system
Filed under: ,
Twitter
RT @ iElectric: @CentrifuzijaTo bi slo :) Si prepripravljena delit stroske? :D Feb 02, 2012 09:58 AM
RT @ nzupan: Everything you need in a foreign city is a Plonista. Everything else sorts itself out. #plone #best #community #ever Feb 01, 2012 02:02 PM
RT @ iElectric: Jenkins (JVM) crashes after few minutes after start http://t.co/NSsnxmQf Jan 31, 2012 09:39 PM
RT @ iElectric: #python tip: date(time) objects have .replace() method: datetime.datetime.now().replace(hour=0, minute=0, second=0, m... Jan 31, 2012 05:56 PM
RT @ nzupan: Arrived to #barcelona! Jan 31, 2012 12:42 PM
RT @ iElectric: When #android is installed in cars, so streaming music with mpd is straightforward from my home, I'm buying one. Jan 29, 2012 05:11 PM
RT @ iElectric: OH: wordpress is an unauthenticated remote shell that, as a useful side feature, also contains a blog Jan 29, 2012 04:43 PM
RT @ iElectric: Wohoo, I can finally not lose time with my music collection - http://t.co/TZmRbv3r Jan 29, 2012 04:06 PM
RT @ iElectric: In #gentoo one can patch sw by putting patches in correctly formatted folders and they will be applied before compili... Jan 29, 2012 02:05 AM
RT @ iElectric: Stop Internet #Censorship! Sign the urgent global petition @Avaaz urging the EU Parliament to reject #ACTA: http://t.... Jan 29, 2012 02:05 AM
RT @ BCSearch: We're back online. :) Read the blog post: http://t.co/uGhsz6VW http://t.co/pAqDOobU Jan 28, 2012 08:17 PM
RT @ nzupan: If you are managing a #plone site with many users, give collective.listusers a try! Jan 28, 2012 07:12 PM
RT @ BCSearch: A maintenance downtime coming up shortly! Jan 28, 2012 06:09 PM
RT @ nzupan: niteoweb.click2sell updated to support plone.app.testing, plus moved to GitHub and http://t.co/e1WHmvMd! #plone @click2 Jan 28, 2012 06:09 PM
RT @ nzupan: Wow, I just got a 7-fold decrease in one of my buildout's run time, thanks to @rosspatterson! You rock dude! #plone Jan 28, 2012 12:17 PM