[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - RolePermissionView.py:1.1.2.3

Jim Fulton jim@zope.com
Sun, 6 Jan 2002 17:37:22 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	RolePermissionView.py 
Log Message:
Added testing flag to RolePermissionView action so it doesn't try to
render a response page when testing functionality.


=== Zope3/lib/python/Zope/App/Security/RolePermissionView.py 1.1.2.2 => 1.1.2.3 ===
                 for permission in self.permissions()]
 
-    def action(self, REQUEST):
+    def action(self, REQUEST, testing=None):
         roles       = [r.getId() for r in self.roles()]
         permissions = [p.getId() for p in self.permissions()]
         prm         = getAdapter(self.getContext(), IRolePermissionManager)
@@ -65,9 +65,10 @@
                 else:
                     prm.retractPermissionFromRole(rperm, rrole)
 
-        return self.index(
-            message="Settings changed at %s" % time.ctime(time.time())
-            )
+        if not testing:
+            return self.index(
+                message="Settings changed at %s" % time.ctime(time.time())
+                )
 
 class PermissionRoles: