If you're into Zope python product stuff, read on, otherwise don't bother.
Thanks to Brian Lloyd (Zope corp) and Florent Guillaume (Nuxeo) I now know how to set security declarations on a class outside the class. It doesn't work like a normal python class (new or old style) which was a bit of a surprise. This is how you do it in a "normal" python class:
class _Z:
def __init__(self):
self.z = "Z"
def declareProtected(self, *a,**k):
print "++declare something+"
def foo():
print "I'm being called"
return _Z()
class A:
security=foo()
def __init__(self):
pass
A.security.declareProtected("foo")