[Checkins] SVN: z3c.layer/tags/0.2.4/ tag version 0.2.4
Christophe Combelles
ccomb at free.fr
Sat Apr 17 20:41:37 EDT 2010
Log message for revision 111026:
tag version 0.2.4
Changed:
A z3c.layer/tags/0.2.4/
D z3c.layer/tags/0.2.4/CHANGES.txt
A z3c.layer/tags/0.2.4/CHANGES.txt
D z3c.layer/tags/0.2.4/setup.py
A z3c.layer/tags/0.2.4/setup.py
D z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt
D z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/bugfixes.txt
D z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml
D z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py
D z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml
D z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml
A z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/bugfixes.txt
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml
D z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml
A z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml
-=-
Deleted: z3c.layer/tags/0.2.4/CHANGES.txt
===================================================================
--- z3c.layer/branches/0.2/CHANGES.txt 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/CHANGES.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,33 +0,0 @@
-=======
-CHANGES
-=======
-
-0.2.3 (2007-11-07)
-------------------
-
-- Forward-Bug: Due to a bug in mechanize, the testbrowser throws
- ``httperror_seek_wrapper`` instead of ``HTTPError`` errors. Thanks to RE
- normalizers, the code will now work whether the bug is fixed or not in
- mechanize.
-
-
-0.2.2 (2007-10-31)
-------------------
-
-- Fixed package meta-data.
-
-- Bug: Fixed test failures due to depency updates.
-
-- Restructure: Fixed deprecation warninf for ``ZopeSecurityPolicy``.
-
-
-0.2.1 (2007-??-??)
-------------------
-
-- Changes unknown.
-
-
-0.2.0 (2007-??-??)
-------------------
-
-- Initial release.
Copied: z3c.layer/tags/0.2.4/CHANGES.txt (from rev 111025, z3c.layer/branches/0.2/CHANGES.txt)
===================================================================
--- z3c.layer/tags/0.2.4/CHANGES.txt (rev 0)
+++ z3c.layer/tags/0.2.4/CHANGES.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,48 @@
+=======
+CHANGES
+=======
+
+0.2.4 (2010-04-18)
+------------------
+
+- **Security issue:** The traversers defined for
+ ``IPageletBrowserLayer`` and ``IMinimalBrowserLayer`` was trusted adapters, so the security
+ proxy got removed from each traversed object. Thus all sub-objects
+ were publically accessable, too.
+
+ Making this change might BREAK your application!
+ That means if security is not well declared.
+
+- Bugfix: use IContentTemplate instead of IPageTemplate which avoids to get the
+ layout template if no IPageTemplate is registered
+
+
+0.2.3 (2007-11-07)
+------------------
+
+- Forward-Bug: Due to a bug in mechanize, the testbrowser throws
+ ``httperror_seek_wrapper`` instead of ``HTTPError`` errors. Thanks to RE
+ normalizers, the code will now work whether the bug is fixed or not in
+ mechanize.
+
+
+0.2.2 (2007-10-31)
+------------------
+
+- Fixed package meta-data.
+
+- Bug: Fixed test failures due to depency updates.
+
+- Restructure: Fixed deprecation warning for ``ZopeSecurityPolicy``.
+
+
+0.2.1 (2007-??-??)
+------------------
+
+- Changes unknown.
+
+
+0.2.0 (2007-??-??)
+------------------
+
+- Initial release.
Deleted: z3c.layer/tags/0.2.4/setup.py
===================================================================
--- z3c.layer/branches/0.2/setup.py 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/setup.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,69 +0,0 @@
-#!python
-##############################################################################
-#
-# Copyright (c) 2007 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Setup
-
-$Id: setup.py 313 2007-05-22 15:33:41Z srichter $
-"""
-import os
-from setuptools import setup, find_packages
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-setup(name = 'z3c.layer',
- version = '0.2.3',
- author='Zope Corporation and Contributors',
- author_email='zope3-dev at zope.org',
- description='Collection of Alternative Base Layers',
- long_description=(
- read('README.txt')
- + '\n\n' +
- read('CHANGES.txt')
- ),
- keywords = "zope3 layer",
- classifiers = [
- 'Development Status :: 5 - Production/Stable',
- 'Environment :: Web Environment',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: Zope Public License',
- 'Programming Language :: Python',
- 'Natural Language :: English',
- 'Operating System :: OS Independent',
- 'Topic :: Internet :: WWW/HTTP',
- 'Framework :: Zope3'],
- url='http://cheeseshop.python.org/pypi/z3c.layer',
- license='ZPL 2.1',
- packages=find_packages('src'),
- package_dir = {'': 'src'},
- namespace_packages=['z3c'],
- extras_require = dict(
- test=['zope.app.testing',
- 'zope.app.securitypolicy',
- 'zope.securitypolicy',
- 'zope.testbrowser',
- ]
- ),
- install_requires = [
- 'setuptools',
- 'z3c.pagelet',
- 'zope.app.http',
- 'zope.app.form',
- 'zope.app.publisher',
- 'zope.configuration',
- 'zope.traversing',
- ],
- include_package_data = True,
- zip_safe = False,
- )
Copied: z3c.layer/tags/0.2.4/setup.py (from rev 111025, z3c.layer/branches/0.2/setup.py)
===================================================================
--- z3c.layer/tags/0.2.4/setup.py (rev 0)
+++ z3c.layer/tags/0.2.4/setup.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,69 @@
+#!python
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup
+
+$Id: setup.py 313 2007-05-22 15:33:41Z srichter $
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(name = 'z3c.layer',
+ version = '0.2.4',
+ author='Zope Corporation and Contributors',
+ author_email='zope3-dev at zope.org',
+ description='Collection of Alternative Base Layers',
+ long_description=(
+ read('README.txt')
+ + '\n\n' +
+ read('CHANGES.txt')
+ ),
+ keywords = "zope3 layer",
+ classifiers = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Framework :: Zope3'],
+ url='http://cheeseshop.python.org/pypi/z3c.layer',
+ license='ZPL 2.1',
+ packages=find_packages('src'),
+ package_dir = {'': 'src'},
+ namespace_packages=['z3c'],
+ extras_require = dict(
+ test=['zope.app.testing',
+ 'zope.securitypolicy',
+ 'zope.app.securitypolicy',
+ 'zope.testbrowser',
+ ]
+ ),
+ install_requires = [
+ 'setuptools',
+ 'z3c.pagelet',
+ 'zope.app.http',
+ 'zope.app.form',
+ 'zope.app.publisher',
+ 'zope.configuration',
+ 'zope.traversing',
+ ],
+ include_package_data = True,
+ zip_safe = False,
+ )
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/minimal/README.txt 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,182 +0,0 @@
-======
-README
-======
-
-This package contains the minimal layer. This layer supports a correct set of
-component registration and can be used for inheritation in custom skins.
-
-Right now the default implementation in Zope3 has different restriction in the
-traversal concept and use to much registration on the default layer.
-
-
-IMinimalBrowserLayer
---------------------
-
-The minimal layer is useful for build custom presentation skins without access
-to ZMI menus like zmi_views etc. This means there is no menu item registred if
-you use this layer.
-
-This layer is NOT derived from IDefaultBrowserLayer. Therefore it provides
-only a minimal set of the most important public views such as @@absolute_url.
-The following packages are accounted:
-
-- zope.app.http.exception
-- zope.app.publication
-- zope.app.publisher.browser
-- zope.app.traversing
-- zope.app.traversing.browser
-
-
-Testing
--------
-
-For testing the IMinimalBrowserLayer we use the testing skin defined in the
-tests package which uses the IMinimalBrowserLayer as the only base layer.
-This means, that our testing skin provides only the views defined in the
-minimal package and it's testing views defined in tests.
-
-Login as manager first:
-
- >>> from zope.testbrowser.testing import Browser
- >>> manager = Browser()
- >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
-
-Check if we can access the page.html view which is registred in the
-ftesting.zcml file with our skin:
-
- >>> manager = Browser()
- >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
- >>> skinURL = 'http://localhost/++skin++MinimalTesting'
- >>> manager.open(skinURL + '/page.html')
- >>> manager.url
- 'http://localhost/++skin++MinimalTesting/page.html'
-
- >>> print manager.contents
- <BLANKLINE>
- <html>
- <head>
- <title>testing</title>
- </head>
- <body>
- <BLANKLINE>
- test page
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
- <BLANKLINE>
-
-Now check the not found page which is a exception view on the exception
-``zope.publisher.interfaces.INotFound``:
-
- >>> manager.open(skinURL + '/foobar.html')
- Traceback (most recent call last):
- ...
- HTTPError: HTTP Error 404: Not Found
-
- >>> print manager.contents
- <BLANKLINE>
- <html>
- <head>
- <title>testing</title>
- </head>
- <body>
- <div>
- <br />
- <br />
- <h3>
- The page you are trying to access is not available
- </h3>
- <br />
- <b>
- Please try the following:
- </b>
- <br />
- <ol>
- <li>
- Make sure that the Web site address is spelled correctly.
- </li>
- <li>
- <a href="javascript:history.back(1);">
- Go back and try another URL.
- </a>
- </li>
- </ol>
- </div>
- </body>
- </html>
- <BLANKLINE>
- <BLANKLINE>
-
-And check the user error page which is a view registred for
-``zope.exceptions.interfaces.IUserError`` exceptions:
-
- >>> manager.open(skinURL + '/@@usererror.html')
- >>> print manager.contents
- <BLANKLINE>
- <html>
- <head>
- <title>testing</title>
- </head>
- <body>
- <div>
- <div>simply user error</div>
- </div>
- </body>
- </html>
- <BLANKLINE>
- <BLANKLINE>
-
-And check error view registred for
-``zope.interface.common.interfaces.IException``:
-
- >>> manager.open(skinURL + '/@@systemerror.html')
- >>> print manager.contents
- <BLANKLINE>
- <html>
- <head>
- <title>testing</title>
- </head>
- <body>
- <div>
- <br />
- <br />
- <h3>A system error occurred</h3>
- <br />
- <b>Please contact the administrator.</b>
- <a href="javascript:history.back(1);">
- Go back and try another URL.
- </a>
- </div>
- </body>
- </html>
- <BLANKLINE>
- <BLANKLINE>
-
-And check the ``zope.security.interfaces.IUnauthorized`` view, use a new
-unregistred user (test browser) for this:
-
- >>> unauthorized = Browser()
- >>> unauthorized.open(skinURL + '/@@forbidden.html')
- Traceback (most recent call last):
- ...
- HTTPError: HTTP Error 401: Unauthorized
-
- >>> print unauthorized.contents
- <BLANKLINE>
- <html>
- <head>
- <title>testing</title>
- </head>
- <body>
- <div>
- <BLANKLINE>
- <h1>Unauthorized</h1>
- <BLANKLINE>
- <p>You are not authorized</p>
- <BLANKLINE>
- </div>
- </body>
- </html>
- <BLANKLINE>
- <BLANKLINE>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/README.txt)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/README.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,182 @@
+======
+README
+======
+
+This package contains the minimal layer. This layer supports a correct set of
+component registration and can be used for inheritance in custom skins.
+
+Right now the default implementation in Zope3 has different restrictions in the
+traversal concept and use to many registrations on the default layer.
+
+
+IMinimalBrowserLayer
+--------------------
+
+The minimal layer is useful for build custom presentation skins without access
+to ZMI menus like zmi_views etc. This means there is no menu item registered if
+you use this layer.
+
+This layer is NOT derived from IDefaultBrowserLayer. Therefore it provides
+only a minimal set of the most important public views such as @@absolute_url.
+The following packages are accounted:
+
+- zope.app.http.exception
+- zope.app.publication
+- zope.app.publisher.browser
+- zope.app.traversing
+- zope.app.traversing.browser
+
+
+Testing
+-------
+
+For testing the IMinimalBrowserLayer we use the testing skin defined in the
+tests package which uses the IMinimalBrowserLayer as the only base layer.
+This means, that our testing skin provides only the views defined in the
+minimal package and it's testing views defined in tests.
+
+Login as manager first:
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> manager = Browser()
+ >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+
+Check if we can access the page.html view which is registred in the
+ftesting.zcml file with our skin:
+
+ >>> manager = Browser()
+ >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+ >>> skinURL = 'http://localhost/++skin++MinimalTesting'
+ >>> manager.open(skinURL + '/page.html')
+ >>> manager.url
+ 'http://localhost/++skin++MinimalTesting/page.html'
+
+ >>> print manager.contents
+ <BLANKLINE>
+ <html>
+ <head>
+ <title>testing</title>
+ </head>
+ <body>
+ <BLANKLINE>
+ test page
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
+ <BLANKLINE>
+
+Now check the not found page which is a exception view on the exception
+``zope.publisher.interfaces.INotFound``:
+
+ >>> manager.open(skinURL + '/foobar.html')
+ Traceback (most recent call last):
+ ...
+ HTTPError: HTTP Error 404: Not Found
+
+ >>> print manager.contents
+ <BLANKLINE>
+ <html>
+ <head>
+ <title>testing</title>
+ </head>
+ <body>
+ <div>
+ <br />
+ <br />
+ <h3>
+ The page you are trying to access is not available
+ </h3>
+ <br />
+ <b>
+ Please try the following:
+ </b>
+ <br />
+ <ol>
+ <li>
+ Make sure that the Web site address is spelled correctly.
+ </li>
+ <li>
+ <a href="javascript:history.back(1);">
+ Go back and try another URL.
+ </a>
+ </li>
+ </ol>
+ </div>
+ </body>
+ </html>
+ <BLANKLINE>
+ <BLANKLINE>
+
+And check the user error page which is a view registred for
+``zope.exceptions.interfaces.IUserError`` exceptions:
+
+ >>> manager.open(skinURL + '/@@usererror.html')
+ >>> print manager.contents
+ <BLANKLINE>
+ <html>
+ <head>
+ <title>testing</title>
+ </head>
+ <body>
+ <div>
+ <div>simply user error</div>
+ </div>
+ </body>
+ </html>
+ <BLANKLINE>
+ <BLANKLINE>
+
+And check error view registred for
+``zope.interface.common.interfaces.IException``:
+
+ >>> manager.open(skinURL + '/@@systemerror.html')
+ >>> print manager.contents
+ <BLANKLINE>
+ <html>
+ <head>
+ <title>testing</title>
+ </head>
+ <body>
+ <div>
+ <br />
+ <br />
+ <h3>A system error occurred</h3>
+ <br />
+ <b>Please contact the administrator.</b>
+ <a href="javascript:history.back(1);">
+ Go back and try another URL.
+ </a>
+ </div>
+ </body>
+ </html>
+ <BLANKLINE>
+ <BLANKLINE>
+
+And check the ``zope.security.interfaces.IUnauthorized`` view, use a new
+unregistred user (test browser) for this:
+
+ >>> unauthorized = Browser()
+ >>> unauthorized.open(skinURL + '/@@forbidden.html')
+ Traceback (most recent call last):
+ ...
+ HTTPError: HTTP Error 401: Unauthorized
+
+ >>> print unauthorized.contents
+ <BLANKLINE>
+ <html>
+ <head>
+ <title>testing</title>
+ </head>
+ <body>
+ <div>
+ <BLANKLINE>
+ <h1>Unauthorized</h1>
+ <BLANKLINE>
+ <p>You are not authorized</p>
+ <BLANKLINE>
+ </div>
+ </body>
+ </html>
+ <BLANKLINE>
+ <BLANKLINE>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/__init__.py 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,79 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2005 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-$Id$
-"""
-
-import zope.interface
-import zope.component
-from zope.publisher.browser import BrowserView, BrowserPage
-from zope.security.interfaces import Unauthorized
-from zope.exceptions.interfaces import UserError
-
-from z3c.layer import minimal
-
-
-class IMinimalTestingSkin(minimal.IMinimalBrowserLayer):
- """The IMinimalBrowserLayer testing skin."""
-
-
-class TestingStandardMacros(BrowserView):
-
- zope.interface.implements(zope.interface.common.mapping.IItemMapping)
-
- macro_pages = ('page_macros', 'view_macros', 'error_macros')
- aliases = {
- 'view': 'page',
- 'dialog': 'page',
- 'addingdialog': 'page'
- }
-
- def __getitem__(self, key):
- key = self.aliases.get(key, key)
- context = self.context
- request = self.request
- for name in self.macro_pages:
- page = zope.component.getMultiAdapter((context, request),
- name=name)
- try:
- v = page[key]
- except KeyError:
- pass
- else:
- return v
- raise KeyError(key)
-
-
-class UnauthorizedPage(BrowserPage):
- """Unauthorized view."""
-
- def __call__(self):
- raise Unauthorized('not authorized')
- return u''
-
-
-class UserErrorPage(BrowserPage):
- """Unauthorized view."""
-
- def __call__(self):
- raise UserError('simply user error')
- return u''
-
-
-class SystemErrorPage(BrowserPage):
- """Unauthorized view."""
-
- def __call__(self):
- raise Exception('simply system error')
- return u''
\ No newline at end of file
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/__init__.py)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/__init__.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,87 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+
+import zope.interface
+import zope.component
+from zope.publisher.browser import BrowserView, BrowserPage
+from zope.security.interfaces import Unauthorized
+from zope.exceptions.interfaces import UserError
+
+from z3c.layer import minimal
+
+
+class IMinimalTestingSkin(minimal.IMinimalBrowserLayer):
+ """The IMinimalBrowserLayer testing skin."""
+
+
+class TestingStandardMacros(BrowserView):
+
+ zope.interface.implements(zope.interface.common.mapping.IItemMapping)
+
+ macro_pages = ('page_macros', 'view_macros', 'error_macros')
+ aliases = {
+ 'view': 'page',
+ 'dialog': 'page',
+ 'addingdialog': 'page'
+ }
+
+ def __getitem__(self, key):
+ key = self.aliases.get(key, key)
+ context = self.context
+ request = self.request
+ for name in self.macro_pages:
+ page = zope.component.getMultiAdapter((context, request),
+ name=name)
+ try:
+ v = page[key]
+ except KeyError:
+ pass
+ else:
+ return v
+ raise KeyError(key)
+
+
+class UnauthorizedPage(BrowserPage):
+ """Unauthorized view."""
+
+ def __call__(self):
+ raise Unauthorized('not authorized')
+ return u''
+
+
+class UserErrorPage(BrowserPage):
+ """Unauthorized view."""
+
+ def __call__(self):
+ raise UserError('simply user error')
+ return u''
+
+
+class SystemErrorPage(BrowserPage):
+ """Unauthorized view."""
+
+ def __call__(self):
+ raise Exception('simply system error')
+ return u''
+
+
+class ContainerContentsPage(BrowserPage):
+ """Contents of a container."""
+
+ def __call__(self):
+ return str([type(x) for x in self.context.values()])
+
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/bugfixes.txt (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/bugfixes.txt)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/bugfixes.txt (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/bugfixes.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,27 @@
+==========
+ Bugfixes
+==========
+
+Traversed objects where not security proxied
+============================================
+
+When an object got traversed its security proxy was removed, so its
+sub-objects could be publically accessed. To show that this behavior
+was fixed we put a folder into the root folder and look at its
+contents using a view:
+
+ >>> import zope.app.folder
+ >>> getRootFolder()['test'] = zope.app.folder.Folder()
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> manager = Browser()
+ >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+ >>> skinURL = 'http://localhost/++skin++MinimalTesting'
+ >>> manager.open(skinURL + '/container_contents.html')
+
+The view displays the types of the content objects inside the root
+folder. The content objects are security proxied:
+
+ >>> print manager.contents
+ [<type 'zope.security._proxy._Proxy'>]
+
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/ftesting.zcml 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,132 +0,0 @@
-<configure xmlns="http://namespaces.zope.org/zope"
- xmlns:meta="http://namespaces.zope.org/meta"
- xmlns:browser="http://namespaces.zope.org/browser"
- i18n_domain="zope"
- package="z3c.layer.minimal.tests">
-
- <include package="zope.app.zcmlfiles" />
-
- <include package="zope.app.securitypolicy" file="meta.zcml" />
- <include package="zope.app.authentication" />
- <securityPolicy
- component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
- <include package="zope.app.securitypolicy" />
-
- <role id="zope.Anonymous" title="Everybody"
- description="All users have this role implicitly" />
-
- <role id="zope.Manager" title="Site Manager" />
-
- <principal
- id="zope.manager"
- title="Administrator"
- login="mgr"
- password="mgrpw" />
-
- <grant
- role="zope.Manager"
- principal="zope.manager"
- />
-
- <unauthenticatedPrincipal
- id="zope.anybody"
- title="Unauthenticated User" />
-
- <unauthenticatedGroup
- id="zope.Anybody"
- title="Unauthenticated Users"
- />
-
- <authenticatedGroup
- id="zope.Authenticated"
- title="Authenticated Users"
- />
-
- <everybodyGroup
- id="zope.Everybody"
- title="All Users"
- />
-
- <grantAll role="zope.Manager" />
-
- <include package="zope.app.form.browser" />
- <include package="zope.app.http.exception" />
- <include package="zope.app.publication" />
- <include package="zope.app.publisher.browser" />
- <include package="zope.traversing" />
- <include package="zope.traversing.browser" />
- <include package="z3c.layer.minimal" />
-
- <interface
- interface="z3c.layer.minimal.tests.IMinimalTestingSkin"
- type="zope.publisher.interfaces.browser.IBrowserSkinType"
- name="MinimalTesting"
- />
-
- <browser:page
- for="*"
- name="standard_macros"
- permission="zope.Public"
- class=".TestingStandardMacros"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- allowed_interface="zope.interface.common.mapping.IItemMapping"
- />
-
- <browser:page
- for="*"
- name="page_macros"
- permission="zope.Public"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- template="page_macros.pt"
- />
-
- <browser:page
- for="*"
- name="view_macros"
- permission="zope.Public"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- template="view_macros.pt"
- />
-
- <browser:page
- for="*"
- name="error_macros"
- permission="zope.Public"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- template="error_macros.pt"
- />
-
- <browser:page
- for="*"
- name="page.html"
- permission="zope.ManageContent"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- template="page.pt"
- />
-
- <browser:page
- for="*"
- name="forbidden.html"
- permission="zope.View"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- class=".UnauthorizedPage"
- />
-
- <browser:page
- for="*"
- name="usererror.html"
- permission="zope.View"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- class=".UserErrorPage"
- />
-
- <browser:page
- for="*"
- name="systemerror.html"
- permission="zope.View"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- class=".SystemErrorPage"
- />
-
-</configure>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/ftesting.zcml)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/ftesting.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,140 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ xmlns:meta="http://namespaces.zope.org/meta"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="zope"
+ package="z3c.layer.minimal.tests">
+
+ <include package="zope.app.zcmlfiles" />
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+ <include package="zope.app.authentication" />
+ <securityPolicy
+ component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <include package="zope.app.securitypolicy" />
+
+ <role id="zope.Anonymous" title="Everybody"
+ description="All users have this role implicitly" />
+
+ <role id="zope.Manager" title="Site Manager" />
+
+ <principal
+ id="zope.manager"
+ title="Administrator"
+ login="mgr"
+ password="mgrpw" />
+
+ <grant
+ role="zope.Manager"
+ principal="zope.manager"
+ />
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User" />
+
+ <unauthenticatedGroup
+ id="zope.Anybody"
+ title="Unauthenticated Users"
+ />
+
+ <authenticatedGroup
+ id="zope.Authenticated"
+ title="Authenticated Users"
+ />
+
+ <everybodyGroup
+ id="zope.Everybody"
+ title="All Users"
+ />
+
+ <grantAll role="zope.Manager" />
+
+ <include package="zope.app.form.browser" />
+ <include package="zope.app.http.exception" />
+ <include package="zope.app.publication" />
+ <include package="zope.app.publisher.browser" />
+ <include package="zope.traversing" />
+ <include package="zope.traversing.browser" />
+ <include package="z3c.layer.minimal" />
+
+ <interface
+ interface="z3c.layer.minimal.tests.IMinimalTestingSkin"
+ type="zope.publisher.interfaces.browser.IBrowserSkinType"
+ name="MinimalTesting"
+ />
+
+ <browser:page
+ for="*"
+ name="standard_macros"
+ permission="zope.Public"
+ class=".TestingStandardMacros"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ allowed_interface="zope.interface.common.mapping.IItemMapping"
+ />
+
+ <browser:page
+ for="*"
+ name="page_macros"
+ permission="zope.Public"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ template="page_macros.pt"
+ />
+
+ <browser:page
+ for="*"
+ name="view_macros"
+ permission="zope.Public"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ template="view_macros.pt"
+ />
+
+ <browser:page
+ for="*"
+ name="error_macros"
+ permission="zope.Public"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ template="error_macros.pt"
+ />
+
+ <browser:page
+ for="*"
+ name="page.html"
+ permission="zope.ManageContent"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ template="page.pt"
+ />
+
+ <browser:page
+ for="*"
+ name="forbidden.html"
+ permission="zope.View"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ class=".UnauthorizedPage"
+ />
+
+ <browser:page
+ for="*"
+ name="usererror.html"
+ permission="zope.View"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ class=".UserErrorPage"
+ />
+
+ <browser:page
+ for="*"
+ name="systemerror.html"
+ permission="zope.View"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ class=".SystemErrorPage"
+ />
+ <browser:page
+ for="*"
+ name="container_contents.html"
+ permission="zope.View"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ class=".ContainerContentsPage"
+ />
+
+
+</configure>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/test_layer.py 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,40 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2005 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-$Id$
-"""
-import re
-import unittest
-from zope.testing import renormalizing
-from zope.app.testing import functional
-
-functional.defineLayer('TestLayer', 'ftesting.zcml')
-
-
-def test_suite():
- suite = unittest.TestSuite()
-
- s = functional.FunctionalDocFileSuite(
- '../README.txt',
- checker = renormalizing.RENormalizing([
- (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
- ])
- )
- s.layer = TestLayer
- suite.addTest(s)
-
- return suite
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/tests/test_layer.py)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/tests/test_layer.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,46 @@
+##############################################################################
+#
+# Copyright (c) 2007-2010 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+import re
+import unittest
+from zope.testing import renormalizing
+from zope.app.testing import functional
+
+
+functional.defineLayer('TestLayer', 'ftesting.zcml')
+
+
+checker = renormalizing.RENormalizing([
+ (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
+ ])
+
+
+def create_suite(*args, **kw):
+ suite = functional.FunctionalDocFileSuite(*args, **kw)
+ suite.layer = TestLayer
+ return suite
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(create_suite('../README.txt', checker=checker))
+ suite.addTest(create_suite('bugfixes.txt'))
+ return suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
+
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/minimal/zope.app.publication.zcml 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,14 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- i18n_domain="z3c">
-
- <browser:view
- for="zope.app.publication.interfaces.IFileContent"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- class="zope.app.publication.traversers.FileContentTraverser"
- permission="zope.Public"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
-</configure>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/zope.app.publication.zcml)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.app.publication.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,14 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="z3c">
+
+ <view
+ for="zope.app.publication.interfaces.IFileContent"
+ type="z3c.layer.minimal.IMinimalBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.publication.traversers.FileContentTraverser"
+ permission="zope.Public"
+ allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
+ />
+
+</configure>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/minimal/zope.traversing.browser.zcml 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,85 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- i18n_domain="z3c">
-
- <adapter
- for="zope.interface.Interface
- z3c.layer.minimal.IMinimalBrowserLayer"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- factory="zope.app.publication.traversers.SimpleComponentTraverser"
- permission="zope.Public"
- trusted="True"
- />
-
- <adapter
- for="zope.app.container.interfaces.IItemContainer
- z3c.layer.minimal.IMinimalBrowserLayer"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- factory="zope.app.container.traversal.ItemTraverser"
- permission="zope.Public"
- trusted="True"
- />
-
- <adapter
- for="zope.app.container.interfaces.ISimpleReadContainer
- z3c.layer.minimal.IMinimalBrowserLayer"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- factory="zope.app.container.traversal.ItemTraverser"
- permission="zope.Public"
- trusted="True"
- />
-
- <view
- for="*"
- name="absolute_url"
- factory="zope.traversing.browser.AbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
- <view
- for="*"
- factory="zope.traversing.browser.AbsoluteURL"
- permission="zope.Public"
- provides="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
- <view
- for="zope.traversing.interfaces.IContainmentRoot"
- name="absolute_url"
- factory="zope.traversing.browser.SiteAbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
- <view
- for="zope.traversing.interfaces.IContainmentRoot"
- factory="zope.traversing.browser.SiteAbsoluteURL"
- permission="zope.Public"
- provides="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
- <browser:page
- for="*"
- name="absolute_url"
- class="zope.traversing.browser.AbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
- <browser:page
- for="zope.traversing.interfaces.IContainmentRoot"
- name="absolute_url"
- class="zope.traversing.browser.SiteAbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- layer="z3c.layer.minimal.IMinimalBrowserLayer"
- />
-
-</configure>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/minimal/zope.traversing.browser.zcml)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/minimal/zope.traversing.browser.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,82 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="z3c">
+
+ <adapter
+ for="zope.interface.Interface
+ z3c.layer.minimal.IMinimalBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.publication.traversers.SimpleComponentTraverser"
+ permission="zope.Public"
+ />
+
+ <adapter
+ for="zope.app.container.interfaces.IItemContainer
+ z3c.layer.minimal.IMinimalBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.container.traversal.ItemTraverser"
+ permission="zope.Public"
+ />
+
+ <adapter
+ for="zope.app.container.interfaces.ISimpleReadContainer
+ z3c.layer.minimal.IMinimalBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.container.traversal.ItemTraverser"
+ permission="zope.Public"
+ />
+
+ <view
+ for="*"
+ name="absolute_url"
+ factory="zope.traversing.browser.AbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.minimal.IMinimalBrowserLayer"
+ />
+
+ <view
+ for="*"
+ factory="zope.traversing.browser.AbsoluteURL"
+ permission="zope.Public"
+ provides="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.minimal.IMinimalBrowserLayer"
+ />
+
+ <view
+ for="zope.traversing.interfaces.IContainmentRoot"
+ name="absolute_url"
+ factory="zope.traversing.browser.SiteAbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.minimal.IMinimalBrowserLayer"
+ />
+
+ <view
+ for="zope.traversing.interfaces.IContainmentRoot"
+ factory="zope.traversing.browser.SiteAbsoluteURL"
+ permission="zope.Public"
+ provides="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.minimal.IMinimalBrowserLayer"
+ />
+
+ <browser:page
+ for="*"
+ name="absolute_url"
+ class="zope.traversing.browser.AbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ />
+
+ <browser:page
+ for="zope.traversing.interfaces.IContainmentRoot"
+ name="absolute_url"
+ class="zope.traversing.browser.SiteAbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ layer="z3c.layer.minimal.IMinimalBrowserLayer"
+ />
+
+</configure>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/README.txt 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,186 +0,0 @@
-======
-README
-======
-
-This package contains the pagelet layer. This layer supports a correct set of
-component registration and can be used for inheritation in custom skins.
-
-Right now the default implementation in Zope3 has different restriction in the
-traversal concept and use to much registration on the default layer.
-
-Important
----------
-
-This layer supports the z3c.pagelet pattern. this means every page e.g. the
-error page is based on the z3c.pagelet concept.
-
-
-IPageletBrowserLayer
---------------------
-
-The pagelet layer is useful for build custom presentation skins without access
-to ZMI menus like zmi_views etc. This means there is no menu item registred if
-you use this layer.
-
-This layer is NOT derived from IDefaultBrowserLayer. Therefore it provides
-only a minimal set of the most important public views such as @@absolute_url.
-The following packages are accounted:
-
-- zope.app.http.exception
-- zope.app.publication
-- zope.app.publisher.browser
-- zope.app.traversing
-- zope.app.traversing.browser
-
-
-Testing
--------
-
-For testing the IPageletBrowserLayer we use the testing skin defined in the
-tests package which uses the IPageletBrowserLayer as the only base layer.
-This means, that our testing skin provides only the views defined in the
-minimal package and it's testing views defined in tests.
-
-Login as manager first:
-
- >>> from zope.testbrowser.testing import Browser
- >>> manager = Browser()
- >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
-
-Check if we can access the page.html view which is registred in the
-ftesting.zcml file with our skin:
-
- >>> manager = Browser()
- >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
- >>> skinURL = 'http://localhost/++skin++MinimalTesting'
- >>> manager.open(skinURL + '/page.html')
- >>> manager.url
- 'http://localhost/++skin++MinimalTesting/page.html'
-
- >>> print manager.contents
- <!DOCTYPE...
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>TestingSkin</title>
- </head>
- <body>
- test page
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
-
-Now check the not found page which is a exception view on the exception
-``zope.publisher.interfaces.INotFound``:
-
- >>> manager.open(skinURL + '/foobar.html')
- Traceback (most recent call last):
- ...
- HTTPError: HTTP Error 404: Not Found
-
- >>> print manager.contents
- <!DOCTYPE...
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>TestingSkin</title>
- </head>
- <body>
- <div>
- <br />
- <br />
- <h3>
- The page you are trying to access is not available
- </h3>
- <br />
- <b>
- Please try the following:
- </b>
- <br />
- <ol>
- <li>
- Make sure that the Web site address is spelled correctly.
- </li>
- <li>
- <a href="javascript:history.back(1);">
- Go back and try another URL.
- </a>
- </li>
- </ol>
- </div>
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
-
-And check the user error page which is a view registred for
-``zope.exceptions.interfaces.IUserError`` exceptions:
-
- >>> manager.open(skinURL + '/@@usererror.html')
- >>> print manager.contents
- <!DOCTYPE...
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>TestingSkin</title>
- </head>
- <body>
- <div>
- <div>simply user error</div>
- </div>
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
-
-And check error view registred for
-``zope.interface.common.interfaces.IException``:
-
- >>> manager.open(skinURL + '/@@systemerror.html')
- >>> print manager.contents
- <!DOCTYPE...
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>TestingSkin</title>
- </head>
- <body>
- <div>
- <br />
- <br />
- <h3>A system error occurred</h3>
- <br />
- <b>Please contact the administrator.</b>
- <a href="javascript:history.back(1);">
- Go back and try another URL.
- </a>
- </div>
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
-
-And check the ``zope.security.interfaces.IUnauthorized`` view, use a new
-unregistred user (test browser) for this:
-
- >>> unauthorized = Browser()
- >>> unauthorized.open(skinURL + '/@@forbidden.html')
- Traceback (most recent call last):
- ...
- HTTPError: HTTP Error 401: Unauthorized
-
- >>> print unauthorized.contents
- <!DOCTYPE...
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>TestingSkin</title>
- </head>
- <body>
- <div>
- <br />
- <br />
- <h3>Unauthorized</h3>
- <br />
- <b>You are not authorized.</b>
- </div>
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/README.txt)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/README.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,186 @@
+======
+README
+======
+
+This package contains the pagelet layer. This layer supports a correct set of
+component registration and can be used for inheritance in custom skins.
+
+Right now the default implementation in Zope3 has different restrictions in the
+traversal concept and uses to many registrations on the default layer.
+
+Important
+---------
+
+This layer supports the z3c.pagelet pattern. this means every page e.g. the
+error page is based on the z3c.pagelet concept.
+
+
+IPageletBrowserLayer
+--------------------
+
+The pagelet layer is useful for build custom presentation skins without access
+to ZMI menus like zmi_views etc. This means there is no menu item registred if
+you use this layer.
+
+This layer is NOT derived from IDefaultBrowserLayer. Therefore it provides
+only a minimal set of the most important public views such as @@absolute_url.
+The following packages are accounted:
+
+- zope.app.http.exception
+- zope.app.publication
+- zope.app.publisher.browser
+- zope.app.traversing
+- zope.app.traversing.browser
+
+
+Testing
+-------
+
+For testing the IPageletBrowserLayer we use the testing skin defined in the
+tests package which uses the IPageletBrowserLayer as the only base layer.
+This means, that our testing skin provides only the views defined in the
+minimal package and it's testing views defined in tests.
+
+Login as manager first:
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> manager = Browser()
+ >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+
+Check if we can access the page.html view which is registred in the
+ftesting.zcml file with our skin:
+
+ >>> manager = Browser()
+ >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+ >>> skinURL = 'http://localhost/++skin++PageletTestSkin'
+ >>> manager.open(skinURL + '/page.html')
+ >>> manager.url
+ 'http://localhost/++skin++PageletTestSkin/page.html'
+
+ >>> print manager.contents
+ <!DOCTYPE...
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>TestingSkin</title>
+ </head>
+ <body>
+ test page
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
+
+Now check the not found page which is a exception view on the exception
+``zope.publisher.interfaces.INotFound``:
+
+ >>> manager.open(skinURL + '/foobar.html')
+ Traceback (most recent call last):
+ ...
+ HTTPError: HTTP Error 404: Not Found
+
+ >>> print manager.contents
+ <!DOCTYPE...
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>TestingSkin</title>
+ </head>
+ <body>
+ <div>
+ <br />
+ <br />
+ <h3>
+ The page you are trying to access is not available
+ </h3>
+ <br />
+ <b>
+ Please try the following:
+ </b>
+ <br />
+ <ol>
+ <li>
+ Make sure that the Web site address is spelled correctly.
+ </li>
+ <li>
+ <a href="javascript:history.back(1);">
+ Go back and try another URL.
+ </a>
+ </li>
+ </ol>
+ </div>
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
+
+And check the user error page which is a view registred for
+``zope.exceptions.interfaces.IUserError`` exceptions:
+
+ >>> manager.open(skinURL + '/@@usererror.html')
+ >>> print manager.contents
+ <!DOCTYPE...
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>TestingSkin</title>
+ </head>
+ <body>
+ <div>
+ <div>simply user error</div>
+ </div>
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
+
+And check error view registred for
+``zope.interface.common.interfaces.IException``:
+
+ >>> manager.open(skinURL + '/@@systemerror.html')
+ >>> print manager.contents
+ <!DOCTYPE...
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>TestingSkin</title>
+ </head>
+ <body>
+ <div>
+ <br />
+ <br />
+ <h3>A system error occurred</h3>
+ <br />
+ <b>Please contact the administrator.</b>
+ <a href="javascript:history.back(1);">
+ Go back and try another URL.
+ </a>
+ </div>
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
+
+And check the ``zope.security.interfaces.IUnauthorized`` view, use a new
+unregistred user (test browser) for this:
+
+ >>> unauthorized = Browser()
+ >>> unauthorized.open(skinURL + '/@@forbidden.html')
+ Traceback (most recent call last):
+ ...
+ HTTPError: HTTP Error 401: Unauthorized
+
+ >>> print unauthorized.contents
+ <!DOCTYPE...
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>TestingSkin</title>
+ </head>
+ <body>
+ <div>
+ <br />
+ <br />
+ <h3>Unauthorized</h3>
+ <br />
+ <b>You are not authorized.</b>
+ </div>
+ <BLANKLINE>
+ </body>
+ </html>
+ <BLANKLINE>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/browser/__init__.py 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,67 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
-"""
-
-import zope.component
-from zope.app.exception.systemerror import SystemErrorView
-from zope.app.exception.browser.unauthorized import Unauthorized
-from zope.app.exception.browser.user import UserErrorView
-from zope.app.exception.browser.notfound import NotFound
-from zope.app import zapi
-from z3c.template.interfaces import IPageTemplate
-from z3c.pagelet import browser
-
-
-class SystemErrorPagelet(browser.BrowserPagelet, SystemErrorView):
- """SystemError pagelet."""
-
-
-class UnauthorizedPagelet(browser.BrowserPagelet, Unauthorized):
- """Unauthorized pagelet."""
-
- def render(self):
- # Set the error status to 403 (Forbidden) in the case when we don't
- # challenge the user
- self.request.response.setStatus(403)
-
- # make sure that squid does not keep the response in the cache
- self.request.response.setHeader(
- 'Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
- self.request.response.setHeader(
- 'Cache-Control', 'no-store, no-cache, must-revalidate')
- self.request.response.setHeader('Pragma', 'no-cache')
-
- principal = self.request.principal
- auth = zapi.principals()
- auth.unauthorized(principal.id, self.request)
- if self.request.response.getStatus() not in (302, 303):
- template = zope.component.getMultiAdapter((self, self.request),
- IPageTemplate)
- return template(self)
-
-
-class UserErrorPagelet(browser.BrowserPagelet, UserErrorView):
- """UserError pagelet."""
-
-
-class NotFoundPagelet(browser.BrowserPagelet, NotFound):
- """NotFound pagelet."""
-
- def render(self):
- self.request.response.setStatus(404)
- template = zope.component.getMultiAdapter((self, self.request),
- IPageTemplate)
- return template(self)
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/browser/__init__.py)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/browser/__init__.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,67 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+
+import zope.component
+from zope.app.exception.systemerror import SystemErrorView
+from zope.app.exception.browser.unauthorized import Unauthorized
+from zope.app.exception.browser.user import UserErrorView
+from zope.app.exception.browser.notfound import NotFound
+from zope.app import zapi
+from z3c.template.interfaces import IContentTemplate
+from z3c.pagelet import browser
+
+
+class SystemErrorPagelet(browser.BrowserPagelet, SystemErrorView):
+ """SystemError pagelet."""
+
+
+class UnauthorizedPagelet(browser.BrowserPagelet, Unauthorized):
+ """Unauthorized pagelet."""
+
+ def render(self):
+ # Set the error status to 403 (Forbidden) in the case when we don't
+ # challenge the user
+ self.request.response.setStatus(403)
+
+ # make sure that squid does not keep the response in the cache
+ self.request.response.setHeader(
+ 'Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
+ self.request.response.setHeader(
+ 'Cache-Control', 'no-store, no-cache, must-revalidate')
+ self.request.response.setHeader('Pragma', 'no-cache')
+
+ principal = self.request.principal
+ auth = zapi.principals()
+ auth.unauthorized(principal.id, self.request)
+ if self.request.response.getStatus() not in (302, 303):
+ template = zope.component.getMultiAdapter((self, self.request),
+ IContentTemplate)
+ return template(self)
+
+
+class UserErrorPagelet(browser.BrowserPagelet, UserErrorView):
+ """UserError pagelet."""
+
+
+class NotFoundPagelet(browser.BrowserPagelet, NotFound):
+ """NotFound pagelet."""
+
+ def render(self):
+ self.request.response.setStatus(404)
+ template = zope.component.getMultiAdapter((self, self.request),
+ IContentTemplate)
+ return template(self)
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/__init__.py 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,57 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
-"""
-
-import zope.interface
-import zope.component
-from zope.publisher.browser import BrowserPage
-from zope.security.interfaces import Unauthorized
-from zope.exceptions.interfaces import UserError
-
-from z3c.pagelet import browser
-import z3c.layer.pagelet
-
-
-class IPageletBrowserTestingSkin(z3c.layer.pagelet.IPageletBrowserLayer):
- """The IJSABrowser testing skin."""
-
-
-class TestPage(browser.BrowserPagelet):
- """Test page."""
-
-
-class UnauthorizedPage(BrowserPage):
- """Unauthorized view."""
-
- def __call__(self):
- raise Unauthorized('not authorized')
- return u''
-
-
-class UserErrorPage(BrowserPage):
- """Unauthorized view."""
-
- def __call__(self):
- raise UserError('simply user error')
- return u''
-
-
-class SystemErrorPage(BrowserPage):
- """Unauthorized view."""
-
- def __call__(self):
- raise Exception('simply system error')
- return u''
\ No newline at end of file
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/__init__.py)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/__init__.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,65 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+
+import zope.interface
+import zope.component
+from zope.publisher.browser import BrowserPage
+from zope.security.interfaces import Unauthorized
+from zope.exceptions.interfaces import UserError
+
+from z3c.pagelet import browser
+import z3c.layer.pagelet
+
+
+class IPageletBrowserTestSkin(z3c.layer.pagelet.IPageletBrowserLayer):
+ """The IJSABrowser testing skin."""
+
+
+class TestPage(browser.BrowserPagelet):
+ """Test page."""
+
+
+class UnauthorizedPage(BrowserPage):
+ """Unauthorized view."""
+
+ def __call__(self):
+ raise Unauthorized('not authorized')
+ return u''
+
+
+class UserErrorPage(BrowserPage):
+ """Unauthorized view."""
+
+ def __call__(self):
+ raise UserError('simply user error')
+ return u''
+
+
+class SystemErrorPage(BrowserPage):
+ """Unauthorized view."""
+
+ def __call__(self):
+ raise Exception('simply system error')
+ return u''
+
+
+class ContainerContentsPage(BrowserPage):
+ """Contents of a container."""
+
+ def __call__(self):
+ return str([type(x) for x in self.context.values()])
+
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/bugfixes.txt (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/bugfixes.txt)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/bugfixes.txt (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/bugfixes.txt 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,27 @@
+==========
+ Bugfixes
+==========
+
+Traversed objects where not security proxied
+============================================
+
+When an object got traversed its security proxy was removed, so its
+sub-objects could be publically accessed. To show that this behavior
+was fixed we put a folder into the root folder and look at its
+contents using a view:
+
+ >>> import zope.app.folder
+ >>> getRootFolder()['test'] = zope.app.folder.Folder()
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> manager = Browser()
+ >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+ >>> skinURL = 'http://localhost/++skin++PageletTestSkin'
+ >>> manager.open(skinURL + '/container_contents.html')
+
+The view displays the types of the content objects inside the root
+folder. The content objects are security proxied:
+
+ >>> print manager.contents
+ [<type 'zope.security._proxy._Proxy'>]
+
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/ftesting.zcml 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,118 +0,0 @@
-<configure xmlns="http://namespaces.zope.org/zope"
- xmlns:meta="http://namespaces.zope.org/meta"
- xmlns:browser="http://namespaces.zope.org/browser"
- xmlns:z3c="http://namespaces.zope.org/z3c"
- i18n_domain="zope"
- package="z3c.layer.pagelet.tests">
-
- <include package="zope.app.zcmlfiles" />
-
- <include package="zope.app.securitypolicy" file="meta.zcml" />
- <include package="zope.app.authentication" />
- <securityPolicy
- component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
- <include package="zope.app.securitypolicy" />
-
- <role id="zope.Anonymous" title="Everybody"
- description="All users have this role implicitly" />
-
- <role id="zope.Manager" title="Site Manager" />
-
- <principal
- id="zope.manager"
- title="Administrator"
- login="mgr"
- password="mgrpw" />
-
- <grant
- role="zope.Manager"
- principal="zope.manager"
- />
-
- <unauthenticatedPrincipal
- id="zope.anybody"
- title="Unauthenticated User" />
-
- <unauthenticatedGroup
- id="zope.Anybody"
- title="Unauthenticated Users"
- />
-
- <authenticatedGroup
- id="zope.Authenticated"
- title="Authenticated Users"
- />
-
- <everybodyGroup
- id="zope.Everybody"
- title="All Users"
- />
-
- <grantAll role="zope.Manager" />
-
- <include package="zope.app.form.browser" />
- <include package="zope.app.http.exception" />
- <include package="zope.app.publication" />
- <include package="zope.app.publisher.browser" />
- <include package="zope.traversing" />
- <include package="zope.traversing.browser" />
- <include package="zope.contentprovider" />
-
- <include package="z3c.template" file="meta.zcml" />
- <include package="z3c.pagelet" file="meta.zcml" />
- <include package="z3c.pagelet" />
-
- <include package="z3c.layer.pagelet" />
-
- <interface
- interface="z3c.layer.pagelet.tests.IPageletBrowserTestingSkin"
- type="zope.publisher.interfaces.browser.IBrowserSkinType"
- name="MinimalTesting"
- />
-
- <z3c:layout
- for="*"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- template="template.pt"
- />
-
- <z3c:pagelet
- for="*"
- name="page.html"
- permission="zope.ManageContent"
- class=".TestPage"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
- <z3c:template
- for=".TestPage"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- template="page.pt"
- />
-
- <browser:page
- for="*"
- name="forbidden.html"
- permission="zope.View"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- class=".UnauthorizedPage"
- />
-
- <browser:page
- for="*"
- name="usererror.html"
- permission="zope.View"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- class=".UserErrorPage"
- />
-
- <browser:page
- for="*"
- name="systemerror.html"
- permission="zope.View"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- class=".SystemErrorPage"
- />
-
-</configure>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/ftesting.zcml)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/ftesting.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,128 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ xmlns:meta="http://namespaces.zope.org/meta"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:z3c="http://namespaces.zope.org/z3c"
+ i18n_domain="zope"
+ package="z3c.layer.pagelet.tests">
+
+ <include package="zope.app.zcmlfiles" />
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+ <include package="zope.app.authentication" />
+ <securityPolicy
+ component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <include package="zope.app.securitypolicy" />
+
+ <role id="zope.Anonymous" title="Everybody"
+ description="All users have this role implicitly" />
+
+ <role id="zope.Manager" title="Site Manager" />
+
+ <principal
+ id="zope.manager"
+ title="Administrator"
+ login="mgr"
+ password="mgrpw" />
+
+ <grant
+ role="zope.Manager"
+ principal="zope.manager"
+ />
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User" />
+
+ <unauthenticatedGroup
+ id="zope.Anybody"
+ title="Unauthenticated Users"
+ />
+
+ <authenticatedGroup
+ id="zope.Authenticated"
+ title="Authenticated Users"
+ />
+
+ <everybodyGroup
+ id="zope.Everybody"
+ title="All Users"
+ />
+
+ <grantAll role="zope.Manager" />
+
+ <include package="zope.app.form.browser" />
+ <include package="zope.app.folder" />
+ <include package="zope.app.http.exception" />
+ <include package="zope.app.publication" />
+ <include package="zope.app.publisher.browser" />
+ <include package="zope.traversing" />
+ <include package="zope.traversing.browser" />
+ <include package="zope.contentprovider" />
+
+ <include package="z3c.template" file="meta.zcml" />
+ <include package="z3c.pagelet" file="meta.zcml" />
+ <include package="z3c.pagelet" />
+
+ <include package="z3c.layer.pagelet" />
+
+ <interface
+ interface="z3c.layer.pagelet.tests.IPageletBrowserTestSkin"
+ type="zope.publisher.interfaces.browser.IBrowserSkinType"
+ name="PageletTestSkin"
+ />
+
+ <z3c:layout
+ for="*"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ template="template.pt"
+ />
+
+ <z3c:pagelet
+ for="*"
+ name="page.html"
+ permission="zope.ManageContent"
+ class=".TestPage"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+ <z3c:template
+ for=".TestPage"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ template="page.pt"
+ />
+
+ <browser:page
+ for="*"
+ name="forbidden.html"
+ permission="zope.View"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ class=".UnauthorizedPage"
+ />
+
+ <browser:page
+ for="*"
+ name="usererror.html"
+ permission="zope.View"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ class=".UserErrorPage"
+ />
+
+ <browser:page
+ for="*"
+ name="systemerror.html"
+ permission="zope.View"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ class=".SystemErrorPage"
+ />
+
+ <browser:page
+ for="*"
+ name="container_contents.html"
+ permission="zope.View"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ class=".ContainerContentsPage"
+ />
+
+
+</configure>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/test_layer.py 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,39 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
-"""
-import re
-import unittest
-from zope.testing import renormalizing
-from zope.app.testing import functional
-
-functional.defineLayer('TestLayer', 'ftesting.zcml')
-
-
-def test_suite():
- suite = unittest.TestSuite()
- s = functional.FunctionalDocFileSuite(
- '../README.txt',
- checker = renormalizing.RENormalizing([
- (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
- ])
- )
- s.layer = TestLayer
- suite.addTest(s)
-
- return suite
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/tests/test_layer.py)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/tests/test_layer.py 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,46 @@
+##############################################################################
+#
+# Copyright (c) 2007-2010 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: test_layer.py 111023 2010-04-17 23:31:18Z ccomb $
+"""
+import re
+import unittest
+from zope.testing import renormalizing
+from zope.app.testing import functional
+
+
+functional.defineLayer('TestLayer', 'ftesting.zcml')
+
+
+checker = renormalizing.RENormalizing([
+ (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
+ ])
+
+
+def create_suite(*args, **kw):
+ suite = functional.FunctionalDocFileSuite(*args, **kw)
+ suite.layer = TestLayer
+ return suite
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(create_suite('../README.txt', checker=checker))
+ suite.addTest(create_suite('bugfixes.txt'))
+ return suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
+
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/zope.app.publication.zcml 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,14 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- i18n_domain="z3c">
-
- <browser:view
- for="zope.app.publication.interfaces.IFileContent"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- class="zope.app.publication.traversers.FileContentTraverser"
- permission="zope.Public"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
-</configure>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/zope.app.publication.zcml)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.app.publication.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,14 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="z3c">
+
+ <view
+ for="zope.app.publication.interfaces.IFileContent"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.publication.traversers.FileContentTraverser"
+ type="z3c.layer.pagelet.IPageletBrowserLayer"
+ permission="zope.Public"
+ allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
+ />
+
+</configure>
Deleted: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml
===================================================================
--- z3c.layer/branches/0.2/src/z3c/layer/pagelet/zope.traversing.browser.zcml 2010-04-17 23:31:18 UTC (rev 111023)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -1,85 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- i18n_domain="z3c">
-
- <adapter
- for="zope.interface.Interface
- z3c.layer.pagelet.IPageletBrowserLayer"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- factory="zope.app.publication.traversers.SimpleComponentTraverser"
- permission="zope.Public"
- trusted="True"
- />
-
- <adapter
- for="zope.app.container.interfaces.IItemContainer
- z3c.layer.pagelet.IPageletBrowserLayer"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- factory="zope.app.container.traversal.ItemTraverser"
- permission="zope.Public"
- trusted="True"
- />
-
- <adapter
- for="zope.app.container.interfaces.ISimpleReadContainer
- z3c.layer.pagelet.IPageletBrowserLayer"
- provides="zope.publisher.interfaces.browser.IBrowserPublisher"
- factory="zope.app.container.traversal.ItemTraverser"
- permission="zope.Public"
- trusted="True"
- />
-
- <view
- for="*"
- name="absolute_url"
- factory="zope.traversing.browser.AbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
- <view
- for="*"
- factory="zope.traversing.browser.AbsoluteURL"
- permission="zope.Public"
- provides="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
- <view
- for="zope.traversing.interfaces.IContainmentRoot"
- name="absolute_url"
- factory="zope.traversing.browser.SiteAbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
- <view
- for="zope.traversing.interfaces.IContainmentRoot"
- factory="zope.traversing.browser.SiteAbsoluteURL"
- permission="zope.Public"
- provides="zope.traversing.browser.interfaces.IAbsoluteURL"
- type="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
- <browser:page
- for="*"
- name="absolute_url"
- class="zope.traversing.browser.AbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
- <browser:page
- for="zope.traversing.interfaces.IContainmentRoot"
- name="absolute_url"
- class="zope.traversing.browser.SiteAbsoluteURL"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- layer="z3c.layer.pagelet.IPageletBrowserLayer"
- />
-
-</configure>
Copied: z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml (from rev 111025, z3c.layer/branches/0.2/src/z3c/layer/pagelet/zope.traversing.browser.zcml)
===================================================================
--- z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml (rev 0)
+++ z3c.layer/tags/0.2.4/src/z3c/layer/pagelet/zope.traversing.browser.zcml 2010-04-18 00:41:37 UTC (rev 111026)
@@ -0,0 +1,82 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="z3c">
+
+ <adapter
+ for="zope.interface.Interface
+ z3c.layer.pagelet.IPageletBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.publication.traversers.SimpleComponentTraverser"
+ permission="zope.Public"
+ />
+
+ <adapter
+ for="zope.app.container.interfaces.IItemContainer
+ z3c.layer.pagelet.IPageletBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.container.traversal.ItemTraverser"
+ permission="zope.Public"
+ />
+
+ <adapter
+ for="zope.app.container.interfaces.ISimpleReadContainer
+ z3c.layer.pagelet.IPageletBrowserLayer"
+ provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+ factory="zope.app.container.traversal.ItemTraverser"
+ permission="zope.Public"
+ />
+
+ <view
+ for="*"
+ name="absolute_url"
+ factory="zope.traversing.browser.AbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+ <view
+ for="*"
+ factory="zope.traversing.browser.AbsoluteURL"
+ permission="zope.Public"
+ provides="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+ <view
+ for="zope.traversing.interfaces.IContainmentRoot"
+ name="absolute_url"
+ factory="zope.traversing.browser.SiteAbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+ <view
+ for="zope.traversing.interfaces.IContainmentRoot"
+ factory="zope.traversing.browser.SiteAbsoluteURL"
+ permission="zope.Public"
+ provides="zope.traversing.browser.interfaces.IAbsoluteURL"
+ type="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+ <browser:page
+ for="*"
+ name="absolute_url"
+ class="zope.traversing.browser.AbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+ <browser:page
+ for="zope.traversing.interfaces.IContainmentRoot"
+ name="absolute_url"
+ class="zope.traversing.browser.SiteAbsoluteURL"
+ permission="zope.Public"
+ allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+ layer="z3c.layer.pagelet.IPageletBrowserLayer"
+ />
+
+</configure>
More information about the checkins
mailing list