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
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
preetwinder
erp5
Commits
b717db2c
Commit
b717db2c
authored
Sep 15, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notification_tool: fix Unauthorized when sending message to person user cannot access
parent
65ca95b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
product/ERP5/Tool/NotificationTool.py
product/ERP5/Tool/NotificationTool.py
+1
-1
product/ERP5/tests/testNotificationTool.py
product/ERP5/tests/testNotificationTool.py
+23
-0
No files found.
product/ERP5/Tool/NotificationTool.py
View file @
b717db2c
...
@@ -288,7 +288,7 @@ class NotificationTool(BaseTool):
...
@@ -288,7 +288,7 @@ class NotificationTool(BaseTool):
searchUsers
=
self
.
acl_users
.
searchUsers
searchUsers
=
self
.
acl_users
.
searchUsers
def
getUserValueByUserId
(
user_id
):
def
getUserValueByUserId
(
user_id
):
user
,
=
searchUsers
(
id
=
user_id
,
exact_match
=
True
)
user
,
=
searchUsers
(
id
=
user_id
,
exact_match
=
True
)
return
portal
.
restrictedTraverse
(
user
[
'path'
])
return
portal
.
un
restrictedTraverse
(
user
[
'path'
])
if
notifier_list
is
None
:
if
notifier_list
is
None
:
# XXX TODO: Use priority_level. Need to implement default notifier query system.
# XXX TODO: Use priority_level. Need to implement default notifier query system.
...
...
product/ERP5/tests/testNotificationTool.py
View file @
b717db2c
...
@@ -485,6 +485,29 @@ Yes, I will go."""
...
@@ -485,6 +485,29 @@ Yes, I will go."""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
stepCheckNotificationWithoutPermissionOnRecipient
(
self
,
sequence
=
None
):
"""
Check that notification is send by user who cannot see recipient
"""
self
.
logout
()
self
.
portal
.
portal_notifications
.
sendMessage
(
recipient
=
sequence
[
'user_a_id'
],
subject
=
'Subject'
,
message
=
'Message'
)
last_message
=
self
.
portal
.
MailHost
.
_last_message
self
.
assertNotEquals
((),
last_message
)
def
test_permission_on_recipient_not_needed
(
self
):
"""Notification Tool can be used to send Messages even when user does not
have permission on sender or recipent documents.
"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
AddUserA
\
Tic
\
CheckNotificationWithoutPermissionOnRecipient
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
class
TestNotificationToolWithCRM
(
TestNotificationTool
):
class
TestNotificationToolWithCRM
(
TestNotificationTool
):
"""Make sure that notification tool works with crm"""
"""Make sure that notification tool works with crm"""
...
...
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