summaryrefslogtreecommitdiff
path: root/addons/web/models
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-02-06 15:03:00 +0100
committerMartin Trigaux <mat@odoo.com>2020-05-14 13:59:10 +0200
commit56a8c9e4311d24c33b7ad08b8230e4be345a85b8 (patch)
tree20ae492b0a187131bae67cc0250f30f686f4231a /addons/web/models
parentccc98e01691b88c2da9c484c0e6de235b9d18548 (diff)
[FIX] *: add sudo when accessing views
The method fields_view_get should be the only way to retrieve the view content. This method is executed in a super-user context. To avoid retrieving views for a model a user does not have access to (as it may reveal some informations like name of fields), add a verification of 'read' rights before retrieving the view content. Execute _postprocess_access_rights with sudo(False) as this method is used to evaluate which buttons should be displayed. Remove the su flag to avoid misleading the user and displaying a button they won't be able to use. Retrieving the database id from an view key is not considered as a sensitive information and get_view_id and viewref can be left as a public methods. Add missing sudo when needed Change _handle_visibility in website to avoid increasing the query count: Checking the visibility (to fail most of the time) to retry in sudo was making unecessary queries.
Diffstat (limited to 'addons/web/models')
0 files changed, 0 insertions, 0 deletions