[CMF-checkins] CVS: Products/CMFCore - ActionProviderBase.py:1.30.2.1

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Oct 5 05:19:25 EDT 2004


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv834/CMFCore

Modified Files:
      Tag: CMF-1_5-branch
	ActionProviderBase.py 
Log Message:
- raise Unauthorized if it is more suitable than ValueError (CookieCrumbler needs that)


=== Products/CMFCore/ActionProviderBase.py 1.30 => 1.30.2.1 ===
--- Products/CMFCore/ActionProviderBase.py:1.30	Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/ActionProviderBase.py	Tue Oct  5 05:19:25 2004
@@ -21,6 +21,7 @@
 
 from ActionInformation import ActionInfo
 from ActionInformation import ActionInformation
+from exceptions import AccessControl_Unauthorized
 from Expression import getExprContext
 from interfaces.portal_actions import ActionProvider as IActionProvider
 from permissions import ManagePortal
@@ -114,11 +115,16 @@
         """ Get an ActionInfo object specified by a chain of actions.
         """
         action_infos = self.listActionInfos(action_chain, object,
-                                       check_visibility=check_visibility,
-                                       check_condition=check_condition, max=1)
+                                            check_visibility=check_visibility,
+                                            check_permissions=False,
+                                            check_condition=check_condition)
         if not action_infos:
             raise ValueError('No Action meets the given specification.')
-        return action_infos[0]
+        for ai in action_infos:
+            if ai['allowed']:
+                return ai
+        raise AccessControl_Unauthorized('You are not allowed to access any '
+                                         'of the specified Actions.')
 
     #
     #   ZMI methods



More information about the CMF-checkins mailing list