[Zope3-checkins] CVS: Zope3/src/zope/app/component - classfactory.py:1.5.8.1 contentdirective.py:1.10.6.1

Jim Fulton jim at zope.com
Fri Sep 12 15:15:50 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/component
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/component

Modified Files:
      Tag: parentgeddon-branch
	classfactory.py contentdirective.py 
Log Message:
Can't have the tests passing, can we?

=== Zope3/src/zope/app/component/classfactory.py 1.5 => 1.5.8.1 ===
--- Zope3/src/zope/app/component/classfactory.py:1.5	Mon Aug  4 19:12:44 2003
+++ Zope3/src/zope/app/component/classfactory.py	Fri Sep 12 15:15:20 2003
@@ -15,16 +15,21 @@
 
 from zope.interface import implements, implementedBy
 from zope.component.interfaces import IFactory
+from zope.security.checker import NamesChecker, CheckerPublic
 
 class ClassFactory:
     "Class that creates a factory component from a class"
 
     implements(IFactory)
 
-    def __init__(self, _class, title='', description=''):
+    def __init__(self, _class, title='', description='', permission=None):
         self._class = _class
         self.title = title
         self.description = description
+        if permission is not None:
+            self.__Security_checker__ = NamesChecker(
+                __call__ = permission,
+                getInterfaces = CheckerPublic)
 
     def __call__(self, *args, **kwargs):
         return self._class(*args, **kwargs)


=== Zope3/src/zope/app/component/contentdirective.py 1.10 => 1.10.6.1 ===
--- Zope3/src/zope/app/component/contentdirective.py:1.10	Sun Aug 17 02:06:15 2003
+++ Zope3/src/zope/app/component/contentdirective.py	Fri Sep 12 15:15:20 2003
@@ -200,16 +200,10 @@
     """
 
     assertPermission(permission)
-    factory = ClassFactory(_class, title, description)
 
     if permission == PublicPermission:
         permission = CheckerPublic
 
-    if permission:
-        # XXX should getInterfaces be public, as below?
-        factory = ProxyFactory(factory,
-                               NamesChecker(('getInterfaces','title',
-                                             'description'),
-                                            __call__=permission))
+    factory = ClassFactory(_class, title, description, permission)
 
     getService(None, Factories).provideFactory(id, factory)




More information about the Zope3-Checkins mailing list