summaryrefslogtreecommitdiff
path: root/addons/website_slides/controllers
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-04-28 08:37:23 +0000
committerThibault Delavallée <tde@odoo.com>2020-05-07 09:03:24 +0000
commit513c6d18dfbabf6bf0dc930b457f34ff94b71cac (patch)
treec75c641898086ed89e9172d7f439127bd5da7237 /addons/website_slides/controllers
parentd0a855985f7782a64c081b2cf4a0b0c22e488950 (diff)
[FIX] website_slides: allow portal users to udpate their review
Followup of 86c80d341846894c435b1c8f61ef946b06e72ec7 : currently portal users face an access issue if they change attachments in their review. This commit fixes that by sudo-ing access to the attachment as other access is already granted. Task ID 2214795 closes odoo/odoo#50815 X-original-commit: 90152abef30e043d36f8a8aabfe18c46e807973f Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_slides/controllers')
-rw-r--r--addons/website_slides/controllers/mail.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_slides/controllers/mail.py b/addons/website_slides/controllers/mail.py
index 30d7c911358..bad841f9795 100644
--- a/addons/website_slides/controllers/mail.py
+++ b/addons/website_slides/controllers/mail.py
@@ -29,7 +29,7 @@ class SlidesPortalChatter(PortalChatter):
'/mail/chatter_update',
], type='http', auth="user")
def mail_update_message(self, res_model, res_id, message, message_id, redirect=None, attachment_ids='', attachment_tokens='', **post):
- # keep this mecanism intern to slide currently (saas 12.5) as it is
+ # keep this mechanism intern to slide currently (saas 12.5) as it is
# considered experimental
if res_model != 'slide.channel':
raise Forbidden()
@@ -57,7 +57,7 @@ class SlidesPortalChatter(PortalChatter):
message = request.env['mail.message'].search(domain, limit=1)
if not message:
raise NotFound()
- message.write({
+ message.sudo().write({
'body': message_body,
'attachment_ids': [(4, aid) for aid in attachment_ids],
})