[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/securitypolicy/zopepolicy. CheckerPublic should always have a permission

Dmitry Vasiliev dima at hlabs.spb.ru
Fri Jul 23 04:16:30 EDT 2004


Log message for revision 26694:
  CheckerPublic should always have a permission
  


Changed:
  U   Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.py
  U   Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.txt


-=-
Modified: Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.py
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.py	2004-07-23 01:39:22 UTC (rev 26693)
+++ Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.py	2004-07-23 08:16:30 UTC (rev 26694)
@@ -18,6 +18,7 @@
 
 import zope.interface
 
+from zope.security.checker import CheckerPublic
 from zope.security.management import system_user
 from zope.security.simplepolicies import ParanoidSecurityPolicy
 from zope.security.interfaces import ISecurityPolicy
@@ -205,6 +206,9 @@
         
 
     def checkPermission(self, permission, object):
+        if permission is CheckerPublic:
+            return True
+
         principals = {}
         for participation in self.participations:
             principal = participation.principal

Modified: Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.txt
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.txt	2004-07-23 01:39:22 UTC (rev 26693)
+++ Zope3/trunk/src/zope/app/securitypolicy/zopepolicy.txt	2004-07-23 08:16:30 UTC (rev 26694)
@@ -72,6 +72,12 @@
   >>> interaction.checkPermission('P1', ob)
   False
 
+But CheckerPublic permission id always have a permission:
+
+  >>> from zope.security.checker import CheckerPublic
+  >>> interaction.checkPermission(CheckerPublic, ob)
+  True
+
 We make grants and denials on objects by adaping them to various
 granting interfaces:
 



More information about the Zope3-Checkins mailing list