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
6199c1e4
Commit
6199c1e4
authored
Sep 04, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup default validated_hook.
parent
ddea96bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
src/ZPublisher/WSGIPublisher.py
src/ZPublisher/WSGIPublisher.py
+8
-2
src/Zope2/App/startup.py
src/Zope2/App/startup.py
+5
-5
No files found.
src/ZPublisher/WSGIPublisher.py
View file @
6199c1e4
...
...
@@ -18,6 +18,7 @@ import sys
from
thread
import
allocate_lock
import
time
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
noSecurityManager
import
transaction
from
zExceptions
import
(
...
...
@@ -78,6 +79,10 @@ def missing_name(name, request):
request
.
response
.
badRequestError
(
name
)
def
validate_user
(
request
,
user
):
newSecurityManager
(
request
,
user
)
def
set_default_debug_mode
(
debug_mode
):
global
_DEFAULT_DEBUG_MODE
_DEFAULT_DEBUG_MODE
=
debug_mode
...
...
@@ -107,7 +112,8 @@ def get_module_info(module_name='Zope2'):
bobo_before
=
getattr
(
module
,
'__bobo_before__'
,
None
)
bobo_after
=
getattr
(
module
,
'__bobo_after__'
,
None
)
error_hook
=
getattr
(
module
,
'zpublisher_exception_hook'
,
None
)
validated_hook
=
getattr
(
module
,
'zpublisher_validated_hook'
,
None
)
validated_hook
=
getattr
(
module
,
'zpublisher_validated_hook'
,
validate_user
)
transactions_manager
=
getattr
(
module
,
'zpublisher_transactions_manager'
,
transaction
.
manager
)
...
...
@@ -115,7 +121,7 @@ def get_module_info(module_name='Zope2'):
error_hook
,
validated_hook
,
transactions_manager
)
_MODULES
[
module_name
]
=
info
return
info
return
info
class
WSGIResponse
(
HTTPResponse
):
...
...
src/Zope2/App/startup.py
View file @
6199c1e4
...
...
@@ -41,6 +41,11 @@ deprecated(
ZPublisherExceptionHook
=
'ZServer.ZPublisher.exceptionhook:ExceptionHook'
,
)
deprecated
(
'Please import from ZPublisher.WSGIPublisher.'
,
validated_hook
=
'ZPublisher.WSGIPublisher:validate_user'
,
)
app
=
None
startup_time
=
asctime
()
_patched
=
False
...
...
@@ -149,8 +154,3 @@ def startup():
notify
(
DatabaseOpenedWithRoot
(
DB
))
Zope2
.
zpublisher_transactions_manager
=
transaction
.
manager
Zope2
.
zpublisher_validated_hook
=
validated_hook
def
validated_hook
(
request
,
user
):
newSecurityManager
(
request
,
user
)
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