summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/data_model.js
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2016-04-25 14:01:01 +0200
committerOlivier Dony <odo@openerp.com>2016-04-25 18:22:44 +0200
commite1ed2c6ddc6750a2090ee37badfaeccadd765b9b (patch)
treee70147c537afd495dc5e8caf91a0877644139fac /addons/web/static/src/js/framework/data_model.js
parentdde1404cb9ce538cc1216c9256f0f5c1e74ecc06 (diff)
[FIX] mail: visibility rules for channel notifications
Avoid raising an access denied error for messages that the user has indeed be notified about. The issue arose when a message posted on a document inaccessible to the user was notified to one of the channels the user is subscribed to. The access control logic on messages relies on 2 heuristics to grant read access to a message: a. either the user was notified about the messages, by being a follower of the document, or a subscriber of a channel following the document (in that case the user can see the message but not the document) b. or the user has read access to the document on which the message is posted (in that case the user can see both the message and the document) Case `a.` sometimes fail to match when a message got notified to several channels including one the user was not subscribed to. Depending on the order of the returned rows in the SQL query, the "foreign" channels could shadow the channels of the user, making `a.` a non-match. If case `b.` did not match either, the user would have the `read` access denied, even though the message was visible by the `search()` method. The fix explicitly makes case `a.` match if the user was notified in *at least* one channel. This was not done through a change of the SQL query ORDER, for readability reasons.
Diffstat (limited to 'addons/web/static/src/js/framework/data_model.js')
0 files changed, 0 insertions, 0 deletions