[FIX] mail: Modifying followers in multi company

In multi company, some followers of a document could be not
readable for a user who has the rights to modify this document.

If the user has the rights to write on a document, he is allowed
to read and modify the followers of this document.

opw:693536
This commit is contained in:
Goffin Simon
2016-12-21 13:36:29 +01:00
parent 9bea8a8bd3
commit b795d69ce8
+4 -1
View File
@@ -114,7 +114,10 @@ class MailController(http.Controller):
is_editable = request.env.user.has_group('base.group_no_one')
partner_id = request.env.user.partner_id
follower_id = None
for follower in request.env['mail.followers'].browse(follower_ids):
follower_recs = request.env['mail.followers'].sudo().browse(follower_ids)
res_ids = follower_recs.mapped('res_id')
request.env[res_model].browse(res_ids).check_access_rule("write")
for follower in follower_recs:
is_uid = partner_id == follower.partner_id
follower_id = follower.id if is_uid else follower_id
followers.append({