I am using Plone 2.1.2, w/ CMF 1.5.5.  I'm having trouble using
the overridden _checkPermission function in 1.5.5 to handle proxy roles on
a FSPythonScript.  After hacking around, I've determined the best method
to repair this issue is to "backport" CMF 1.6.0's function and make
_checkPermission call SecurityManager's _checkPermission.  I don't really
want to change the core libraries, so my idea was to do it as a monkey

So, I added this monkey patch to one of my custom zope products:

from AccessControl import getSecurityManager

def _checkPermission(permission, obj):
    return getSecurityManager().checkPermission(permission, obj)

import Products.CMFCore.utils
Products.CMFCore.utils._checkPermission = _checkPermission

But every time I use _checkPermission from Products.CMFCore.utils I'm
still getting the old one...  Is it possible to monkey patch functions (as
opposed to methods)?  Any idea why this monkey patch wouldn't be working?


Matt Hahnfeld

Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to