summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_api.rst
diff options
context:
space:
mode:
authorjem-odoo <jem@openerp.com>2019-01-31 08:43:57 +0000
committerjem-odoo <jem@openerp.com>2019-02-06 09:55:13 +0000
commit17ac041bfa2d92a11339e63016bce4696362b333 (patch)
treecdf5fd4273de8b04e6ad7906ef079c4e6d242913 /doc/reference/javascript_api.rst
parent4cb228d823e0346e6052091d397249b8e39d576b (diff)
[REF] portal: posting message with signed token
Before this commit, it was possible to post a message on a document the user has no access, thanks to a token. In addition to this token, if a hash (signed token with a partner id), the author_id of the message was forced. This commit change a little bit that logic by distinguish 2 cases: 1/ Token only: anyone with the token can post a message on the document. If the user is not logged (public with token), the author_id will be the customer of the document (or the public user). This case is moslty used for business document, through the portal or with the "share link" for instance. 2/ Signed token: user has no write access to the document, but can post a message on it. The user have to be logged, as the token is signed with its identifier. The goal here is to avoid leaking the access token's document to all visitors. This case is mostly used for public content, such as blog posts, slides, ... The token case was already existing. The second is now working with this commit. To do so, it was required to - move `_sign_token` from the portal mixin to mail.thread. - transfering 'pid' and 'hash' parameters from the controller to template to js widgets. This commit also change the `_message_post_helper` signature by making the 3 first parameters required, as to post a message you need at lease res_model, res_id and the message body. The optional argurments and kwargs are here to check the bypassing access rights mecanism. Task-1902304
Diffstat (limited to 'doc/reference/javascript_api.rst')
0 files changed, 0 insertions, 0 deletions