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
1b105b23
Commit
1b105b23
authored
Mar 26, 2010
by
Martin Aspeli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge r110185 from 2.12 branch
parent
a93eaae4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
src/Products/Five/browser/resource.py
src/Products/Five/browser/resource.py
+5
-0
src/Products/Five/browser/tests/resource.txt
src/Products/Five/browser/tests/resource.txt
+8
-1
No files found.
src/Products/Five/browser/resource.py
View file @
1b105b23
...
...
@@ -162,6 +162,11 @@ class DirectoryResource(Resource,
resource
=
factory
(
name
,
filename
)(
self
.
request
)
resource
.
__name__
=
name
resource
.
__parent__
=
self
# We need to propagate security so that restrictedTraverse() will
# work
resource
.
__roles__
=
self
.
__roles__
return
resource
class
DirectoryResourceFactory
(
ResourceFactory
):
...
...
src/Products/Five/browser/tests/resource.txt
View file @
1b105b23
...
...
@@ -69,7 +69,6 @@ PageTemplateResource's __call__ renders the template
... if not isinstance(resource, PageTemplateResource):
... self.assertEquals(resource(), base_url % r)
Security
--------
...
...
@@ -108,6 +107,14 @@ We can now view them all:
... path = base % resource
... checkRestricted(self.folder, 'context.restrictedTraverse("%s")' % path)
Let's make sure restrictedTraverse() works directly, too. It used to get
tripped up on subdirectories due to missing security declarations.
>>> self.folder.restrictedTraverse('++resource++fivetest_resources/resource.txt') is not None
True
>>> self.folder.restrictedTraverse('++resource++fivetest_resources/resource_subdir/resource.txt') is not None
True
Clean up
--------
...
...
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