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
Carlos Ramos Carreño
erp5
Commits
6a0bf442
Commit
6a0bf442
authored
Jun 06, 2012
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get roles from the portal instead of the root to get more roles.
parent
d32e2b6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+8
-9
No files found.
product/CMFActivity/ActivityTool.py
View file @
6a0bf442
...
@@ -241,7 +241,9 @@ class Message(BaseMessage):
...
@@ -241,7 +241,9 @@ class Message(BaseMessage):
def
changeUser
(
self
,
user_name
,
activity_tool
):
def
changeUser
(
self
,
user_name
,
activity_tool
):
"""restore the security context for the calling user."""
"""restore the security context for the calling user."""
uf
=
activity_tool
.
getPortalObject
().
acl_users
portal
=
activity_tool
.
getPortalObject
()
portal_uf
=
portal
.
acl_users
uf
=
portal_uf
user
=
uf
.
getUserById
(
user_name
)
user
=
uf
.
getUserById
(
user_name
)
# if the user is not found, try to get it from a parent acl_users
# if the user is not found, try to get it from a parent acl_users
# XXX this is still far from perfect, because we need to store all
# XXX this is still far from perfect, because we need to store all
...
@@ -249,16 +251,13 @@ class Message(BaseMessage):
...
@@ -249,16 +251,13 @@ class Message(BaseMessage):
# replay the activity with exactly the same security context as if
# replay the activity with exactly the same security context as if
# it had been executed without activity.
# it had been executed without activity.
if
user
is
None
:
if
user
is
None
:
uf
=
activity_tool
.
getPortalObject
()
.
aq_parent
.
acl_users
uf
=
portal
.
aq_parent
.
acl_users
user
=
uf
.
getUserById
(
user_name
)
user
=
uf
.
getUserById
(
user_name
)
if
user
is
None
and
user_name
==
system_user
.
getUserName
():
if
user
is
None
and
user_name
==
system_user
.
getUserName
():
# The following logic comes from unrestricted_apply()
# The following logic partly comes from unrestricted_apply()
# implementation in ERP5Type.UnrestrictedMethod.
# implementation in ERP5Type.UnrestrictedMethod but we get roles
try
:
# from the portal to have more roles.
# XXX is it better to get roles from the parent (i.e. portal)?
uf
=
portal_uf
uf
=
user
.
aq_inner
.
aq_parent
except
AttributeError
:
uf
=
app
().
acl_users
role_list
=
uf
.
valid_roles
()
role_list
=
uf
.
valid_roles
()
user
=
PrivilegedUser
(
user_name
,
None
,
role_list
,
()).
__of__
(
uf
)
user
=
PrivilegedUser
(
user_name
,
None
,
role_list
,
()).
__of__
(
uf
)
if
user
is
not
None
:
if
user
is
not
None
:
...
...
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