[Zope3-checkins] CVS: Zope3/src/zope/security - simplepolicies.py:1.3

Godefroid Chapelle gotcha@swing.be
Fri, 11 Apr 2003 18:15:48 -0400


Update of /cvs-repository/Zope3/src/zope/security
In directory cvs.zope.org:/tmp/cvs-serv9040/security

Modified Files:
	simplepolicies.py 
Log Message:
- added usage argument to ZCML menu directive
  The menu usage is used by the configuration to initialize 
  the page view usage in case a page is registered as a
  menu item included in a menu declared with a usage argument.

- added corresponding tests

- various ZCML refactorings to improve usage initialization

- added tests for menu and usage on page directive



=== Zope3/src/zope/security/simplepolicies.py 1.2 => 1.3 ===
--- Zope3/src/zope/security/simplepolicies.py:1.2	Thu Mar 13 13:49:16 2003
+++ Zope3/src/zope/security/simplepolicies.py	Fri Apr 11 18:15:48 2003
@@ -16,6 +16,7 @@
 from zope.security.interfaces import ISecurityPolicy
 from zope.exceptions import Unauthorized
 from zope.security.management import system_user
+import zope.security.checker
 
 class ParanoidSecurityPolicy:
     """
@@ -24,6 +25,8 @@
     __implements__ = ISecurityPolicy
 
     def checkPermission(self, permission, object, context):
+        if permission is zope.security.checker.CheckerPublic:
+            return 1
         if (context.user is system_user   # no user
             and not context.stack  # no untrusted code
             ):