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
0adf58da
Commit
0adf58da
authored
Jul 12, 2022
by
Levin Zimmermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! AlarmTool: handle automatic solve with alarms owned by system user
parent
5ee598ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5/Document/Alarm.py
product/ERP5/Document/Alarm.py
+6
-6
No files found.
product/ERP5/Document/Alarm.py
View file @
0adf58da
...
...
@@ -29,6 +29,7 @@
from
compiler.consts
import
CO_VARKEYWORDS
from
DateTime
import
DateTime
from
random
import
getrandbits
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
...
...
@@ -103,7 +104,7 @@ class Alarm(XMLObject, PeriodicityMixin):
return
'%s_%s'
%
(
self
.
getRelativeUrl
(),
id
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'activeSense'
)
def
activeSense
(
self
,
fixit
=
0
,
params
=
None
):
def
activeSense
(
self
,
fixit
=
0
,
activate_kw
=
(),
params
=
None
):
"""
This method launches the sensing process as activities.
It is intended to launch a very long process made
...
...
@@ -113,11 +114,10 @@ class Alarm(XMLObject, PeriodicityMixin):
The result of the sensing process can be obtained by invoking
the sense method or by requesting a report.
"""
portal_membership
=
self
.
getPortalObject
().
portal_membership
if
fixit
or
not
self
.
getEnabled
():
checkPermission
=
portal_membership
.
checkPermission
if
not
checkPermission
(
Permissions
.
ManagePortal
,
self
):
raise
Unauthorized
(
'fixing problems or activating a disabled alarm is not allowed'
)
activate_kw
=
dict
(
activate_kw
)
if
(
fixit
or
not
self
.
getEnabled
())
and
not
self
.
getPortalObject
().
portal_membership
.
checkPermission
(
Permissions
.
ManagePortal
,
self
):
raise
Unauthorized
(
'fixing problems or activating a disabled alarm is not allowed'
)
# Use UnrestrictedMethod, so that the behavior would not
# change even if this method is invoked by random users.
...
...
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