[Zope-Checkins] CVS: Zope2 - SecurityInfo.py:1.9

Brian Lloyd brian@digicool.com
Thu, 12 Apr 2001 10:30:04 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/AccessControl
In directory korak:/home/brian/temp/mainline_test/lib/python/AccessControl

Modified Files:
	SecurityInfo.py 
Log Message:
setDefaultAccess did not correctly handle 'allow' and 'deny' as stated 
in the documentation



--- Updated File SecurityInfo.py in package Zope2 --
--- SecurityInfo.py	2001/02/08 16:45:35	1.8
+++ SecurityInfo.py	2001/04/12 14:30:03	1.9
@@ -114,6 +114,7 @@
 
 
 import Acquisition, PermissionRole, sys
+from string import lower
 from zLOG import LOG, WARNING
 
 
@@ -197,6 +198,14 @@
         This should be a boolean value, a map of attribute names to
         booleans, or a callable (name, value) -> boolean.
         """
+        if type(access) == type(''):
+            access = lower(access)
+            if access == 'allow':
+                access = 1
+            elif access == 'deny':
+                access = 0
+            else:
+                raise ValueError, "'allow' or 'deny' expected"
         self.access = access