[Zope3-checkins] CVS: zopeproducts/bugtracker/browser - bug.py:1.12

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Aug 30 02:09:44 EDT 2003


Update of /cvs-repository/zopeproducts/bugtracker/browser
In directory cvs.zope.org:/tmp/cvs-serv4290/src/zopeproducts/bugtracker/browser

Modified Files:
	bug.py 
Log Message:
okay, now this little security check also works with TTW-defined users. 
Damn ContextWrappers!


=== zopeproducts/bugtracker/browser/bug.py 1.11 => 1.12 ===
--- zopeproducts/bugtracker/browser/bug.py:1.11	Thu Aug 28 01:22:31 2003
+++ zopeproducts/bugtracker/browser/bug.py	Sat Aug 30 01:09:42 2003
@@ -52,7 +52,8 @@
         container = self.context
 
         if IComment.isImplementedBy(content):
-            names = filter(lambda n: n.startswith('comment'), container.keys())
+            names = filter(lambda n: n.startswith('comment'),
+                           container.keys())
             int_names = map(lambda n: int(n[7:]), names)
             if not container.keys():
                 self.contentName = 'comment1'
@@ -357,10 +358,11 @@
 
     def canChangeDependencies(self):
         deps = zapi.getAdapter(self.context, IBugDependencies)
+        deps = zapi.ContextWrapper(deps, self.context, name='Dependencies')
         proxy = ProxyFactory(deps)
         checker = getChecker(proxy)
         try:
-            checker.check_setattr(self, 'dependencies')
+            checker.check_setattr(deps, 'dependencies')
         except (Unauthorized, ForbiddenAttribute):
             return False
         return True




More information about the Zope3-Checkins mailing list