[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - globalbrowsermenuservice.py:1.28.16.2

Marius Gedminas marius at pov.lt
Mon Mar 8 16:51:28 EST 2004


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

Modified Files:
      Tag: mgedmin-events2-branch
	globalbrowsermenuservice.py 
Log Message:
Added a checkPermission method to zope.security.



=== Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py 1.28.16.1 => 1.28.16.2 ===
--- Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py:1.28.16.1	Mon Mar  8 13:43:39 2004
+++ Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py	Mon Mar  8 16:50:57 2004
@@ -24,7 +24,9 @@
 from zope.app.services.servicenames import Interfaces
 from zope.security.checker import CheckerPublic
 from zope.security.management import getSecurityPolicy, getInteraction
-from zope.app.security.permission import checkPermission
+from zope.security import checkPermission
+from zope.app.security.permission import checkPermission \
+                                            as checkPermissionDefined
 from zope.app.component.metaconfigure import handler
 from zope.app.interfaces.publisher.browser import IBrowserMenuService
 from zope.app.interfaces.publisher.browser import IGlobalBrowserMenuService
@@ -93,8 +95,6 @@
 
         result = []
         seen = {}
-        policy = getSecurityPolicy()
-        interaction = getInteraction()
 
         # stuff for figuring out the selected view
         request_url = request.getURL()
@@ -128,8 +128,7 @@
             if permission:
                 # If we have an explicit permission, check that we
                 # can access it.
-                if (not policy.checkPermission(permission, object, interaction)
-                    and permission is not CheckerPublic):
+                if not checkPermission(permission, object):
                     continue
 
             elif action:
@@ -226,7 +225,7 @@
             if permission == 'zope.Public':
                 permission = CheckerPublic
             else:
-                checkPermission(None, permission)
+                checkPermissionDefined(None, permission)
 
         data = registry.get(interface) or []
         data.append(




More information about the Zope3-Checkins mailing list