[Zope-Checkins] CVS: Zope/lib/python/App - Management.py:1.50.22.1 Product.py:1.52.30.1

Jim Fulton jim@zope.com
Mon, 15 Oct 2001 17:23:14 -0400


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

Modified Files:
      Tag: cAccessControl-review-branch
	Management.py Product.py 
Log Message:
Checking in changes made during review of new cAccessControl
implementation. The changes fall into two classes:

- Changes made to C code

- Switching to use of Unauthorized class exception.
  This one is especially significant. :)


=== Zope/lib/python/App/Management.py 1.50 => 1.50.22.1 ===
 from Globals import DTMLFile, HTMLFile
 from string import split, join, find
-from AccessControl import getSecurityManager
+from AccessControl import getSecurityManager, Unauthorized
 
 class Tabs(ExtensionClass.Base):
     """Mix-in provides management folder tab support."""
@@ -145,8 +145,8 @@
             m=options[0]['action']
             if m=='manage_workspace': raise TypeError
         except:
-            raise 'Unauthorized', (
-                'You are not authorized to view this object.<p>')
+            raise Unauthorized, (
+                'You are not authorized to view this object.')
 
         if find(m,'/'):
             raise 'Redirect', (


=== Zope/lib/python/App/Product.py 1.52 => 1.52.30.1 ===
 from HelpSys.HelpSys import ProductHelp
 import RefreshFuncs
+from AccessControl import Unauthorized
 
 
 class ProductFolder(Folder):
@@ -447,7 +448,7 @@
         Attempts to perform a refresh operation.
         '''
         if self._readRefreshTxt() is None:
-            raise 'Unauthorized', 'refresh.txt not found'
+            raise Unauthorized, 'refresh.txt not found'
         message = None
         if RefreshFuncs.performFullRefresh(self._p_jar, self.id):
             from ZODB import Connection
@@ -463,7 +464,7 @@
         Changes the auto refresh flag for this product.
         '''
         if self._readRefreshTxt() is None:
-            raise 'Unauthorized', 'refresh.txt not created'
+            raise Unauthorized, 'refresh.txt not created'
         RefreshFuncs.enableAutoRefresh(self._p_jar, self.id, enable)
         if enable:
             message = 'Enabled auto refresh.'
@@ -477,7 +478,7 @@
         Selects which products to refresh simultaneously.
         '''
         if self._readRefreshTxt() is None:
-            raise 'Unauthorized', 'refresh.txt not created'
+            raise Unauthorized, 'refresh.txt not created'
         RefreshFuncs.setDependentProducts(self._p_jar, self.id, selections)
         if REQUEST is not None:
             return self.manage_refresh(REQUEST)