[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - ZMIViewUtility.py:1.1.2.9
Steve Alexander
steve@cat-box.net
Mon, 10 Jun 2002 16:40:13 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv24404/lib/python/Zope/App/ZMI
Modified Files:
Tag: Zope-3x-branch
ZMIViewUtility.py
Log Message:
Made tabs that you don't have permission to see disappear.
This must have stopped working when the new name-based security system
came in.
There's probably a better way to check for authorisation than catching
an Unauthorized exception. Why not ask the security proxy? I'll check
to see if this is possible.
=== Zope3/lib/python/Zope/App/ZMI/ZMIViewUtility.py 1.1.2.8 => 1.1.2.9 ===
context = self.context
+ request = self.request
zmi_view_service = getService(context, 'ZMIViewService')
zmi_views=[]
traverser = PublicationTraverser()
@@ -47,7 +48,9 @@
action=view[1]
if action:
try:
- traverser.traversePath(self.request, context, action)
+ # need to tickle its __call__ method to get the
+ # security checker to pay attention
+ traverser.traversePath(request, context, action).__call__
except Unauthorized:
continue # Skip unauthorized
zmi_views.append({'label': label, 'action': "%s" % action})