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

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


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

Modified Files:
      Tag: zope-2_3-branch
	SecurityInfo.py 
Log Message:
Fixed a bug in setDefaultAccess



--- Updated File SecurityInfo.py in package Zope2 --
--- SecurityInfo.py	2001/02/08 17:00:49	1.7.2.1
+++ SecurityInfo.py	2001/04/12 14:29:13	1.7.2.2
@@ -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