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
Klaus Wölfel
erp5
Commits
eb3ebc37
Commit
eb3ebc37
authored
May 22, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AlarmTool: restore security manager after tic
parent
0edd03d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
product/ERP5/Tool/AlarmTool.py
product/ERP5/Tool/AlarmTool.py
+14
-9
No files found.
product/ERP5/Tool/AlarmTool.py
View file @
eb3ebc37
...
@@ -30,7 +30,8 @@ import time
...
@@ -30,7 +30,8 @@ import time
import
threading
import
threading
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
newSecurityManager
,
setSecurityManager
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
,
PersistentMapping
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
,
PersistentMapping
from
Products.ERP5Type.Core.Folder
import
Folder
from
Products.ERP5Type.Core.Folder
import
Folder
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
...
@@ -128,14 +129,18 @@ class AlarmTool(TimerServiceMixin, BaseTool):
...
@@ -128,14 +129,18 @@ class AlarmTool(TimerServiceMixin, BaseTool):
We will look at all alarms and see if they should be activated,
We will look at all alarms and see if they should be activated,
if so then we will activate them.
if so then we will activate them.
"""
"""
for
alarm
in
self
.
getAlarmList
(
to_active
=
1
):
security_manager
=
getSecurityManager
()
if
alarm
is
not
None
:
try
:
user
=
alarm
.
getWrappedOwner
()
for
alarm
in
self
.
getAlarmList
(
to_active
=
1
):
newSecurityManager
(
self
.
REQUEST
,
user
)
if
alarm
is
not
None
:
if
alarm
.
isActive
()
or
not
alarm
.
isEnabled
():
user
=
alarm
.
getWrappedOwner
()
# do nothing if already active, or not enabled
newSecurityManager
(
self
.
REQUEST
,
user
)
continue
if
alarm
.
isActive
()
or
not
alarm
.
isEnabled
():
alarm
.
activeSense
()
# do nothing if already active, or not enabled
continue
alarm
.
activeSense
()
finally
:
setSecurityManager
(
security_manager
)
security
.
declarePrivate
(
'process_timer'
)
security
.
declarePrivate
(
'process_timer'
)
def
process_timer
(
self
,
interval
,
tick
,
prev
=
""
,
next
=
""
):
def
process_timer
(
self
,
interval
,
tick
,
prev
=
""
,
next
=
""
):
...
...
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