Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
17d7db1d
Commit
17d7db1d
authored
Jun 26, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r113898:113899 from 2.12 branch
parent
cd542651
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
1 deletion
+41
-1
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/Products/Five/browser/meta.zcml
src/Products/Five/browser/meta.zcml
+1
-1
src/Products/Five/browser/metaconfigure.py
src/Products/Five/browser/metaconfigure.py
+37
-0
No files found.
doc/CHANGES.rst
View file @
17d7db1d
...
...
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
++++++++++
- LP #578326: Issue a warning if someone specifies a non-public permission
attribute in the browser:view directive. This attribute has never been
supported in Zope 2.
Features Added
++++++++++++++
...
...
src/Products/Five/browser/meta.zcml
View file @
17d7db1d
...
...
@@ -42,7 +42,7 @@
<meta:complexDirective
name="view"
schema="
zope.browserpage.metadirectives.I
ViewDirective"
schema="
.metaconfigure.IFive
ViewDirective"
handler=".metaconfigure.view"
>
...
...
src/Products/Five/browser/metaconfigure.py
View file @
17d7db1d
...
...
@@ -20,6 +20,7 @@ $Id$
"""
import
os
from
inspect
import
ismethod
import
warnings
from
zope
import
component
from
zope.interface
import
implements
...
...
@@ -31,11 +32,13 @@ from zope.publisher.interfaces import NotFound
from
zope.publisher.interfaces.browser
import
IDefaultBrowserLayer
from
zope.publisher.interfaces.browser
import
IBrowserPublisher
from
zope.publisher.interfaces.browser
import
IBrowserRequest
from
zope.security.zcml
import
Permission
import
zope.browserpage.metaconfigure
from
zope.browserpage.metaconfigure
import
providesCallable
from
zope.browserpage.metaconfigure
import
_handle_menu
from
zope.browserpage.metaconfigure
import
_handle_for
from
zope.browserpage.metadirectives
import
IViewDirective
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.security
import
getSecurityInfo
...
...
@@ -178,8 +181,42 @@ class pages(zope.browserpage.metaconfigure.pages):
# view (named view with pages)
class
IFiveViewDirective
(
IViewDirective
):
permission
=
Permission
(
title
=
u"Permission"
,
description
=
u"The permission needed to use the view."
,
required
=
False
,
)
class
view
(
zope
.
browserpage
.
metaconfigure
.
view
):
# Let the permission default to zope.Public and not be required
# We should support this, as more users are expecting it to work.
def
__init__
(
self
,
_context
,
permission
=
None
,
for_
=
Interface
,
name
=
''
,
layer
=
IDefaultBrowserLayer
,
class_
=
None
,
allowed_interface
=
None
,
allowed_attributes
=
None
,
menu
=
None
,
title
=
None
,
provides
=
Interface
,
):
if
permission
is
None
:
permission
=
'zope.Public'
elif
permission
in
(
'zope.Public'
,
'zope2.Public'
):
# No need to warn about the default case
pass
else
:
warnings
.
warn
(
"The permission option of the <browser:view /> "
"directive is not supported in Zope 2. "
+
\
"Ignored for %s in %s"
%
(
str
(
class_
),
_context
.
info
),
stacklevel
=
3
)
super
(
view
,
self
).
__init__
(
_context
,
permission
,
for_
=
for_
,
name
=
name
,
layer
=
layer
,
class_
=
class_
,
allowed_interface
=
allowed_interface
,
allowed_attributes
=
allowed_attributes
,
menu
=
menu
,
title
=
title
,
provides
=
provides
)
def
__call__
(
self
):
(
_context
,
name
,
for_
,
permission
,
layer
,
class_
,
allowed_interface
,
allowed_attributes
)
=
self
.
args
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment