Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
erp5
Commits
c5f8e57a
Commit
c5f8e57a
authored
Sep 13, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to Products.PloneHotfix20121106 based on version 1.2.
parent
8d582563
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
product/PloneHotfix20121106/allow_module.py
product/PloneHotfix20121106/allow_module.py
+2
-15
product/PloneHotfix20121106/ftp.py
product/PloneHotfix20121106/ftp.py
+15
-4
No files found.
product/PloneHotfix20121106/allow_module.py
View file @
c5f8e57a
import
AccessControl.SecurityInfo
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
import
AccessControl
def
allow_module
(
module_name
):
"""Allow a module and all its contents to be used from a
restricted Script. The argument module_name may be a simple
or dotted module or package name. Note that if a package
path is given, all modules in the path will be available."""
ModuleSecurityInfo
(
module_name
).
setDefaultAccess
(
1
)
ModuleSecurityInfo
(
module_name
).
declarePrivate
(
'allow_module'
)
dot
=
module_name
.
find
(
'.'
)
while
dot
>
0
:
ModuleSecurityInfo
(
module_name
[:
dot
]).
setDefaultAccess
(
1
)
ModuleSecurityInfo
(
module_name
).
declarePrivate
(
'allow_module'
)
dot
=
module_name
.
find
(
'.'
,
dot
+
1
)
AccessControl
.
allow_module
=
AccessControl
.
SecurityInfo
.
allow_module
=
allow_module
AccessControl
.
allow_module
.
__roles__
=
()
product/PloneHotfix20121106/ftp.py
View file @
c5f8e57a
...
...
@@ -2,8 +2,19 @@ from AccessControl import getSecurityManager
from
zExceptions
import
Unauthorized
from
OFS.ObjectManager
import
ObjectManager
old_manage_FTPlist
=
ObjectManager
.
manage_FTPlist
ObjectManager
.
__
old_manage_FTPlist
=
ObjectManager
.
manage_FTPlist
def
manage_FTPlist
(
self
,
REQUEST
):
if
not
getSecurityManager
().
checkPermission
(
'Access contents information'
,
self
):
raise
Unauthorized
(
'Not allowed to access contents.'
)
ObjectManager
.
manage_FTPlist
=
manage_FTPlist
\ No newline at end of file
"""Returns a directory listing consisting of a tuple of
(id,stat) tuples, marshaled to a string. Note, the listing it
should include '..' if there is a Folder above the current
one.
In the case of non-foldoid objects it should return a single
tuple (id,stat) representing itself."""
if
not
getSecurityManager
().
checkPermission
(
'Access contents information'
,
self
):
raise
Unauthorized
(
'Not allowed to access contents.'
)
return
self
.
__old_manage_FTPlist
(
REQUEST
)
ObjectManager
.
manage_FTPlist
=
manage_FTPlist
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