[Checkins] SVN: grok/trunk/src/grok/ftests/security/preserve_permissions.py Add security test for contents.html on folders.
Uli Fouquet
uli at gnufix.de
Fri Jan 9 07:46:47 EST 2009
Log message for revision 94676:
Add security test for contents.html on folders.
Changed:
U grok/trunk/src/grok/ftests/security/preserve_permissions.py
-=-
Modified: grok/trunk/src/grok/ftests/security/preserve_permissions.py
===================================================================
--- grok/trunk/src/grok/ftests/security/preserve_permissions.py 2009-01-09 12:38:39 UTC (rev 94675)
+++ grok/trunk/src/grok/ftests/security/preserve_permissions.py 2009-01-09 12:46:46 UTC (rev 94676)
@@ -29,6 +29,23 @@
WWW-Authenticate: basic realm="Zope"
...
+We can allow our application to be viewed by the Zope standard
+``contents.html`` view for site folders. For this we make it provide
+`ISiteManagementFolder`::
+
+ >>> from zope.app.component.interfaces import ISiteManagementFolder
+ >>> from zope.interface import alsoProvides
+ >>> alsoProvides(root['app'], ISiteManagementFolder)
+
+Now there is a ``contents.html`` view available for our application,
+which is protected by default::
+
+ >>> print http(r'''
+ ... GET /app/@@contents.html HTTP/1.1
+ ... ''')
+ HTTP/1.1 401 Unauthorized
+ ...
+
However, if we make a grant, e.g. on the root object, we can access
the view just fine:
More information about the Checkins
mailing list