[CMF-checkins] CVS: CMF/CMFCore - utils.py:1.48

Yvo Schubbe schubbe at web.de
Thu Jan 8 07:30:03 EST 2004


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv15522/CMFCore

Modified Files:
	utils.py 
Log Message:
- replaced Unauthorized strings by class exceptions


=== CMF/CMFCore/utils.py 1.47 => 1.48 ===
--- CMF/CMFCore/utils.py:1.47	Tue Jan  6 03:52:00 2004
+++ CMF/CMFCore/utils.py	Thu Jan  8 07:29:32 2004
@@ -42,6 +42,8 @@
 from Products.PageTemplates.Expressions import getEngine
 from Products.PageTemplates.Expressions import SecureModuleImporter
 
+from CMFCoreExceptions import AccessControl_Unauthorized
+
 
 security = ModuleSecurityInfo( 'Products.CMFCore.utils' )
 
@@ -165,8 +167,8 @@
                 __traceback_info__ = ( ti.getId(), target )
                 return obj.restrictedTraverse( target )
 
-        raise 'Unauthorized', ('No accessible views available for %s' %
-                               '/'.join(obj.getPhysicalPath()))
+        raise AccessControl_Unauthorized( 'No accessible views available for '
+                                    '%s' % '/'.join( obj.getPhysicalPath() ) )
     else:
         raise 'Not Found', ('Cannot find default view for "%s"' %
                             '/'.join(obj.getPhysicalPath()))
@@ -188,7 +190,7 @@
         return
     for role in roles:
         if role not in special_roles and role not in user_roles:
-            raise 'Unauthorized', 'Too many roles specified.'
+            raise AccessControl_Unauthorized('Too many roles specified.')
 
 limitGrantedRoles = _limitGrantedRoles  # XXX: Deprecated spelling
 




More information about the CMF-checkins mailing list