summaryrefslogtreecommitdiff
path: root/addons/website_form/controllers
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2016-11-25 10:01:14 +0100
committerRaphael Collet <rco@openerp.com>2017-01-03 16:52:49 +0100
commit5d746d0ac663232d656bb57e82fec290bb5d82fd (patch)
treef1d51602745c28b43ab84a309fcbc7080c60e5c9 /addons/website_form/controllers
parent1abd543f1412cf16953fd28659baabf1e4df6010 (diff)
[IMP] base, *: tighten `ir.model` access rights
Remove unrestricted "read" access. To make code internally using `ir.model` work, add a private method `_get` on `ir.model` to retrieve the record corresponding to a model name, without access rights issue. Change signature of method `get_authorized_fields` to make it use a model name instead of a model id. This removes the necessity of a search on `ir.model`.
Diffstat (limited to 'addons/website_form/controllers')
-rw-r--r--addons/website_form/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_form/controllers/main.py b/addons/website_form/controllers/main.py
index 742a8eeb0b7..2f5f7ec2292 100644
--- a/addons/website_form/controllers/main.py
+++ b/addons/website_form/controllers/main.py
@@ -21,7 +21,7 @@ class WebsiteForm(http.Controller):
# Check and insert values from the form on the model <model>
@http.route('/website_form/<string:model_name>', type='http', auth="public", methods=['POST'], website=True)
def website_form(self, model_name, **kwargs):
- model_record = request.env['ir.model'].search([('model', '=', model_name), ('website_form_access', '=', True)])
+ model_record = request.env['ir.model'].sudo().search([('model', '=', model_name), ('website_form_access', '=', True)])
if not model_record:
return json.dumps(False)