diff options
| author | Jorge Pinna Puissant <jpp@odoo.com> | 2020-04-21 12:57:23 +0000 |
|---|---|---|
| committer | Jorge Pinna Puissant <jpp@odoo.com> | 2020-05-11 10:06:05 +0000 |
| commit | 5faf3ce15ecb12ad78e6adaddf022fbadc539c00 (patch) | |
| tree | 2288c24b90ca89eb08e050ea3674ece49a6a2148 /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 44ce4baaddbdb68d0c49888fcc1867da965f496d (diff) | |
[FIX] mail: unlink user notifications with related record
Message with type user_notification are special "invisible"
notifications that are not accessible to users normally. That's why they
were excluded from the automatic message deletion in
mail.thread.unlink(), to avoid permission errors. But this caused
orphans leftover notifications in the database, and the fix here is to
instead do the deletion of messages in sudo mode, and make sure
user_notification messages are deleted as well.
Doing this is not a security risk because the deletion of the record
itself (the super call) is still done without sudo, and if it fails,
the whole transaction will be rolled back. And it is part of the
expected ACLs for messages that if you can delete a record you are
allowed delete its messages. The fact that user_notification messages
are not accessible by normal users is for usability reasons (noise in
chatter), not security reasons.
opw-2234282
closes odoo/odoo#51010
X-original-commit: 094559aef4fdfebcba43a089cec4da5f4028a8f2
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions
