[Checkins] SVN: grok/trunk/src/grok/ftests/security/grok_view.py Demonstrate that a Grok-based view is apparently allowed no matter whether

Martijn Faassen faassen at infrae.com
Thu Jan 8 14:26:25 EST 2009


Log message for revision 94647:
  Demonstrate that a Grok-based view is apparently allowed no matter whether
  it implements IGrokSecurityView... For some reason it doesn't get 
  security proxied anyway.
  

Changed:
  A   grok/trunk/src/grok/ftests/security/grok_view.py

-=-
Added: grok/trunk/src/grok/ftests/security/grok_view.py
===================================================================
--- grok/trunk/src/grok/ftests/security/grok_view.py	                        (rev 0)
+++ grok/trunk/src/grok/ftests/security/grok_view.py	2009-01-08 19:26:25 UTC (rev 94647)
@@ -0,0 +1,28 @@
+"""
+Grok views provide `IGrokSecurityView` are handled more openly by the
+Grok publisher.
+
+We create an app::
+
+  >>> root = getRootFolder()
+  >>> root['app'] = App()
+
+Now we can look at the view::
+
+  >>> from zope.testbrowser.testing import Browser
+  >>> browser = Browser()
+  >>> browser.handleErrors = False
+  >>> browser.open('http://localhost/app/@@index')
+  >>> print browser.contents
+  Hello world
+
+"""
+import grok
+from zope.publisher.browser import BrowserPage
+
+class App(grok.Application, grok.Container):
+    pass
+
+class Index(grok.View):
+    def render(self):
+        return "Hello world"



More information about the Checkins mailing list