[Zope3-checkins] CVS: Zope3/src/zope/security - checker.py:1.8
Jim Fulton
jim@zope.com
Fri, 7 Mar 2003 13:40:15 -0500
Update of /cvs-repository/Zope3/src/zope/security
In directory cvs.zope.org:/tmp/cvs-serv30076
Modified Files:
checker.py
Log Message:
Changed the marker object, CheckerPublic to be picklable (as a global
object). This will allow the value to be safely stored in persistent
objects.
=== Zope3/src/zope/security/checker.py 1.7 => 1.8 ===
--- Zope3/src/zope/security/checker.py:1.7 Sun Feb 23 10:18:14 2003
+++ Zope3/src/zope/security/checker.py Fri Mar 7 13:39:41 2003
@@ -16,7 +16,20 @@
# Marker for public attributes
-CheckerPublic = object()
+
+class Global(object):
+
+ def __init__(self, name, module=None):
+ if module is None:
+ module = sys._getframe(1).f_locals['__name__']
+
+ self.__name__ = name
+ self.__module__ = module
+
+ def __reduce__(self):
+ return self.__name__
+
+CheckerPublic = Global('CheckerPublic')
def ProxyFactory(object, checker=None):
"""Factory function that creates a proxy for an object