[Zope3-checkins] CVS: Zope3/src/zope/app/browser/security - permissionwidget.py:1.8

Jim Fulton jim@zope.com
Fri, 21 Mar 2003 15:59:28 -0500


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

Modified Files:
	permissionwidget.py 
Log Message:

Changed to allow non-selection of a permission.

A src/zope/app/browser/services/componentpathwidget.py

Added a simple widget for displaying component paths when 
configuring components.

This widget is a bit unusual in 2 ways:

- It doesn't accept user input, because the component path
  is fixed.

- It behaves differently depending on whether the view (also field) 
  context is a configuration object or something else.




=== Zope3/src/zope/app/browser/security/permissionwidget.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/security/permissionwidget.py:1.7	Fri Mar  7 16:14:37 2003
+++ Zope3/src/zope/app/browser/security/permissionwidget.py	Fri Mar 21 15:58:58 2003
@@ -26,11 +26,17 @@
 class BaseWidget:
 
     def _convert(self, permission_id):
+        if not permission_id:
+            # No permission selected
+            return None
+        
         if type(permission_id) is unicode:
             try:
                 permission_id = permission_id.encode('ascii')
             except UnicodeError, v:
                 raise ConversionError("Invalid textual data", v)
+
+            
 
         if permission_id == 'zope.Public':
             permission_id = CheckerPublic