[Zope-Checkins] CVS: Releases/Zope/lib/python/App - ProductContext.py:1.36

Matthew T. Kromer matt@zope.com
Fri, 9 Nov 2001 11:06:37 -0500


Update of /cvs-repository/Releases/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv27593/lib/python/App

Modified Files:
	ProductContext.py 
Log Message:
Put in a sanity check for permissions='string' in context setup; permissions
should not be a string, use permission='string' for that. The behavior
for iterating over all elements of a string is of course to create lots of
single-letter permissions.

This fixes Collector issue 22, from runyaga


=== Releases/Zope/lib/python/App/ProductContext.py 1.35 => 1.36 ===
 
         if permissions:
+            if type(permissions) is type(''): # You goofed it!
+                raise TypeError, ('Product context permissions should be a '
+                    'list of permissions not a string', permissions)
             for p in permissions:
                 if type(p) is tt:
                     p, default= p