[Checkins] SVN: grok/branches/grokcore.xxx/src/grok/ This ftest and
grok.Public moved to grokcore.view.
Philipp von Weitershausen
philikon at philikon.de
Tue Jul 22 15:10:59 EDT 2008
Log message for revision 88729:
This ftest and grok.Public moved to grokcore.view.
Changed:
U grok/branches/grokcore.xxx/src/grok/__init__.py
U grok/branches/grokcore.xxx/src/grok/components.py
D grok/branches/grokcore.xxx/src/grok/ftests/security/require.py
-=-
Modified: grok/branches/grokcore.xxx/src/grok/__init__.py
===================================================================
--- grok/branches/grokcore.xxx/src/grok/__init__.py 2008-07-22 19:10:37 UTC (rev 88728)
+++ grok/branches/grokcore.xxx/src/grok/__init__.py 2008-07-22 19:10:57 UTC (rev 88729)
@@ -38,11 +38,11 @@
from grok.components import Site, LocalUtility, Annotation
from grok.components import Application, Form, AddForm, EditForm, DisplayForm
from grok.components import Indexes
-from grok.components import Role, Public
+from grok.components import Role
from grok.components import RESTProtocol, IRESTLayer
from grok.interfaces import IRESTSkinType
from grok.components import ViewletManager, Viewlet
-from grokcore.view import Permission, Skin, IGrokLayer
+from grokcore.view import Permission, Public, Skin, IGrokLayer
from grokcore.view import PageTemplate, PageTemplateFile
from martian import baseclass
Modified: grok/branches/grokcore.xxx/src/grok/components.py
===================================================================
--- grok/branches/grokcore.xxx/src/grok/components.py 2008-07-22 19:10:37 UTC (rev 88728)
+++ grok/branches/grokcore.xxx/src/grok/components.py 2008-07-22 19:10:57 UTC (rev 88729)
@@ -361,8 +361,6 @@
Indexes = IndexesClass('Indexes')
-Public = 'zope.Public'
-
class Role(Role):
pass
Deleted: grok/branches/grokcore.xxx/src/grok/ftests/security/require.py
===================================================================
--- grok/branches/grokcore.xxx/src/grok/ftests/security/require.py 2008-07-22 19:10:37 UTC (rev 88728)
+++ grok/branches/grokcore.xxx/src/grok/ftests/security/require.py 2008-07-22 19:10:57 UTC (rev 88729)
@@ -1,45 +0,0 @@
-"""
-Viewing a protected view with insufficient privileges will yield
-Unauthorized:
-
- >>> from zope.testbrowser.testing import Browser
- >>> browser = Browser()
- >>> browser.open("http://localhost/@@painting")
- Traceback (most recent call last):
- HTTPError: HTTP Error 401: Unauthorized
-
-When we log in (e.g. as a manager), we can access the view just fine:
-
- >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
- >>> browser.handleErrors = False
- >>> browser.open("http://localhost/@@painting")
- >>> print browser.contents
- What a beautiful painting.
-
-A view protected with 'zope.Public' is always accessible:
-
- >>> browser = Browser()
- >>> browser.open("http://localhost/@@publicnudity")
- >>> print browser.contents
- Everybody can see this.
-"""
-
-import grok
-import zope.interface
-
-class ViewPainting(grok.Permission):
- grok.name('cave.ViewPainting')
-
-class Painting(grok.View):
- grok.context(zope.interface.Interface)
- grok.require(ViewPainting)
-
- def render(self):
- return 'What a beautiful painting.'
-
-class PublicNudity(grok.View):
- grok.context(zope.interface.Interface)
- grok.require(grok.Public)
-
- def render(self):
- return 'Everybody can see this.'
More information about the Checkins
mailing list