[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - ZopeSecurityPolicy.py:1.1.2.28

Steve Alexander steve@cat-box.net
Sun, 9 Jun 2002 14:24:41 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv29407/lib/python/Zope/App/Security

Modified Files:
      Tag: Zope-3x-branch
	ZopeSecurityPolicy.py 
Log Message:
made ZopeSecurityPolicy assert it implements ISecurityPolicy
started added zcml docs.



=== Zope3/lib/python/Zope/App/Security/ZopeSecurityPolicy.py 1.1.2.27 => 1.1.2.28 ===
 from Zope.Proxy.ContextWrapper import ContainmentIterator
 from Zope.Exceptions import Unauthorized, Forbidden
+from Zope.Security.ISecurityPolicy import ISecurityPolicy
 from Zope.App.Security.IRolePermissionManager import IRolePermissionManager
 from Zope.App.Security.IPrincipalPermissionManager \
     import IPrincipalPermissionManager
@@ -46,7 +47,9 @@
 
 class ZopeSecurityPolicy:
 
-    def __init__( self, ownerous=1, authenticated=1 ):
+    __implements__ = ISecurityPolicy
+
+    def __init__(self, ownerous=1, authenticated=1):
         """
             Two optional keyword arguments may be provided:
 
@@ -72,7 +75,7 @@
         self._ownerous=ownerous
         self._authenticated=authenticated
 
-    def checkPermission( self, permission, object, context ):
+    def checkPermission(self, permission, object, context):
         # XXX We aren't really handling multiple principals yet
 
         principals = { context.user : 1 }