Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
c0f5a868
Commit
c0f5a868
authored
Sep 05, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5 Activity Tool: Donot change the user while calling method
parent
5e4421ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+6
-3
No files found.
product/CMFActivity/ActivityTool.py
View file @
c0f5a868
...
@@ -54,7 +54,6 @@ from zExceptions import ExceptionFormatter
...
@@ -54,7 +54,6 @@ from zExceptions import ExceptionFormatter
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBTree
from
Zope2
import
app
from
Zope2
import
app
from
Products.ERP5Type.UnrestrictedMethod
import
PrivilegedUser
from
Products.ERP5Type.UnrestrictedMethod
import
PrivilegedUser
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
zope.site.hooks
import
setSite
from
zope.site.hooks
import
setSite
import
transaction
import
transaction
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
...
@@ -301,7 +300,7 @@ class Message(BaseMessage):
...
@@ -301,7 +300,7 @@ class Message(BaseMessage):
try
:
try
:
# Change user if required (TO BE DONE)
# Change user if required (TO BE DONE)
# We will change the user only in order to execute this method
# We will change the user only in order to execute this method
self
.
changeUser
(
self
.
user_name
,
activity_tool
)
#
self.changeUser(self.user_name, activity_tool)
# XXX: There is no check to see if user is allowed to access
# XXX: There is no check to see if user is allowed to access
# that method !
# that method !
method
=
getattr
(
obj
,
self
.
method_id
)
method
=
getattr
(
obj
,
self
.
method_id
)
...
@@ -994,7 +993,6 @@ class ActivityTool (Folder, UniqueObject):
...
@@ -994,7 +993,6 @@ class ActivityTool (Folder, UniqueObject):
LOG
(
'CMFActivity'
,
INFO
,
"Shutdown: Activities finished."
)
LOG
(
'CMFActivity'
,
INFO
,
"Shutdown: Activities finished."
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'process_timer'
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'process_timer'
)
@
UnrestrictedMethod
def
process_timer
(
self
,
tick
,
interval
,
prev
=
""
,
next
=
""
):
def
process_timer
(
self
,
tick
,
interval
,
prev
=
""
,
next
=
""
):
"""
"""
Call distribute() if we are the Distributing Node and call tic()
Call distribute() if we are the Distributing Node and call tic()
...
@@ -1013,6 +1011,11 @@ class ActivityTool (Folder, UniqueObject):
...
@@ -1013,6 +1011,11 @@ class ActivityTool (Folder, UniqueObject):
self
.
setupCurrentSkin
(
self
.
REQUEST
)
self
.
setupCurrentSkin
(
self
.
REQUEST
)
old_sm
=
getSecurityManager
()
old_sm
=
getSecurityManager
()
try
:
try
:
# get owner of portal_catalog, so normally we should be able to
# have the permission to invoke all activities
user
=
self
.
portal_catalog
.
getWrappedOwner
()
newSecurityManager
(
self
.
REQUEST
,
user
)
currentNode
=
self
.
getCurrentNode
()
currentNode
=
self
.
getCurrentNode
()
self
.
registerNode
(
currentNode
)
self
.
registerNode
(
currentNode
)
processing_node_list
=
self
.
getNodeList
(
role
=
ROLE_PROCESSING
)
processing_node_list
=
self
.
getNodeList
(
role
=
ROLE_PROCESSING
)
...
...
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