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
bddecc2a
Commit
bddecc2a
authored
Nov 07, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update so callbacks happen as "nobody" user.
parent
a1625a5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
lib/python/Products/Transience/Transience.py
lib/python/Products/Transience/Transience.py
+23
-14
No files found.
lib/python/Products/Transience/Transience.py
View file @
bddecc2a
...
...
@@ -85,10 +85,10 @@
"""
Core session tracking SessionData class.
$Id: Transience.py,v 1.1
1 2001/11/07 20:20:26
matt Exp $
$Id: Transience.py,v 1.1
2 2001/11/07 22:09:53
matt Exp $
"""
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -98,7 +98,10 @@ from TransienceInterfaces import Transient, DictionaryLike, ItemWithId,\
from
OFS.SimpleItem
import
SimpleItem
from
Persistence
import
Persistent
,
PersistentMapping
from
Acquisition
import
Implicit
,
aq_base
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
,
getSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
import
AccessControl.SpecialUsers
from
AccessControl.User
import
nobody
from
BTrees
import
OOBTree
from
zLOG
import
LOG
,
WARNING
import
os.path
...
...
@@ -124,6 +127,7 @@ MANAGE_CONTAINER_PERM = 'Manage Transient Object Container'
constructTransientObjectContainerForm
=
HTMLFile
(
'dtml/addTransientObjectContainer'
,
globals
())
def
constructTransientObjectContainer
(
self
,
id
,
title
=
''
,
timeout_mins
=
20
,
addNotification
=
None
,
delNotification
=
None
,
REQUEST
=
None
):
...
...
@@ -169,7 +173,7 @@ class TransientObjectContainer(SimpleItem):
security
.
setPermissionDefault
(
ACCESS_CONTENTS_PERM
,
[
'Manager'
,
'Anonymous'
])
security
.
setPermissionDefault
(
ACCESS_TRANSIENTS_PERM
,
[
'Manager'
,
'Anonymous'
])
[
'Manager'
,
'Anonymous'
,
'Sessions'
])
security
.
setPermissionDefault
(
CREATE_TRANSIENTS_PERM
,
[
'Manager'
,])
...
...
@@ -318,16 +322,21 @@ class TransientObjectContainer(SimpleItem):
if
callable
(
method
):
try
:
method
(
item
,
self
)
except
:
# dont raise, just log
path
=
self
.
getPhysicalPath
()
LOG
(
'Transience'
,
WARNING
,
'%s failed when calling %s in %s'
%
(
name
,
callback
,
'/'
.
join
(
path
)),
error
=
sys
.
exc_info
()
)
user
=
getSecurityManager
().
getUser
()
try
:
newSecurityManager
(
None
,
nobody
)
method
(
item
,
self
)
except
:
# dont raise, just log
path
=
self
.
getPhysicalPath
()
LOG
(
'Transience'
,
WARNING
,
'%s failed when calling %s in %s'
%
(
name
,
callback
,
'/'
.
join
(
path
)),
error
=
sys
.
exc_info
()
)
finally
:
newSecurityManager
(
None
,
user
)
else
:
err
=
'%s in %s attempted to call non-callable %s'
path
=
self
.
getPhysicalPath
()
...
...
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