Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
Zope
Commits
d657c712
Commit
d657c712
authored
13 years ago
by
Hanno Schlichting
Browse files
Options
Download
Email Patches
Plain Diff
Merge security fix from 2.13 branch
parent
55053f4f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
1 deletion
+77
-1
src/Zope2/App/configure.zcml
src/Zope2/App/configure.zcml
+1
-1
src/Zope2/App/exclude.zcml
src/Zope2/App/exclude.zcml
+1
-0
src/Zope2/App/traversing.py
src/Zope2/App/traversing.py
+14
-0
src/Zope2/App/traversing.zcml
src/Zope2/App/traversing.zcml
+61
-0
No files found.
src/Zope2/App/configure.zcml
View file @
d657c712
...
...
@@ -5,7 +5,7 @@
<include file="meta.zcml" />
<include package="AccessControl" file="permissions.zcml" />
<include
package="zope.
traversing" />
<include
file="
traversing
.zcml
" />
<include package="OFS "/>
<include package="ZPublisher" />
...
...
This diff is collapsed.
Click to expand it.
src/Zope2/App/exclude.zcml
View file @
d657c712
...
...
@@ -3,6 +3,7 @@
<exclude package="zope.browserpage" file="meta.zcml" />
<exclude package="zope.browsermenu" file="meta.zcml" />
<exclude package="zope.browserresource" file="meta.zcml" />
<exclude package="zope.traversing" />
<exclude package="zope.publisher" file="meta.zcml" />
<exclude package="zope.viewlet" file="meta.zcml" />
...
...
This diff is collapsed.
Click to expand it.
src/Zope2/App/traversing.py
0 → 100644
View file @
d657c712
from
zExceptions
import
Forbidden
from
zope.interface.interface
import
InterfaceClass
from
zope.traversing
import
namespace
class
resource
(
namespace
.
view
):
def
traverse
(
self
,
name
,
ignored
):
# The context is important here, since it becomes the parent of the
# resource, which is needed to generate the absolute URL.
res
=
namespace
.
getResource
(
self
.
context
,
name
,
self
.
request
)
if
isinstance
(
res
,
InterfaceClass
):
raise
Forbidden
(
'Access to traverser is forbidden.'
)
return
res
This diff is collapsed.
Click to expand it.
src/Zope2/App/traversing.zcml
0 → 100644
View file @
d657c712
<configure xmlns="http://namespaces.zope.org/zope">
<!-- define default namespace adapters, etc. -->
<adapter
for="*"
factory="zope.traversing.adapters.Traverser"
provides="zope.traversing.interfaces.ITraverser" />
<adapter
for="*"
factory="zope.traversing.adapters.DefaultTraversable"
provides="zope.traversing.interfaces.ITraversable" />
<adapter
name="etc"
for="*"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.etc"
/>
<adapter
name="etc"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.etc"
/>
<adapter
name="adapter"
for="*"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.adapter"
/>
<adapter
name="adapter"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.adapter"
/>
<adapter
name="skin"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.skin"
/>
<adapter
name="resource"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="Zope2.App.traversing.resource"
/>
<adapter
name="view"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.view"
/>
</configure>
This diff is collapsed.
Click to expand it.
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