[FIX] web_editor: remove the editable key if no write on the model

The `check_access_rule` call allow to remove the `editable` key from the
rendering context (which will lead to the display of the editor bar) if
an access rule prevents the edition of the ir.ui.view record. Also remove
it in case the user has no write access on the model (i.e. demo user).
This commit is contained in:
Simon Lejeune
2016-07-05 17:44:56 +02:00
parent 27787265dd
commit 5c54571f4e
+1 -1
View File
@@ -22,7 +22,7 @@ class view(osv.osv):
if '.' not in id_or_xml_id:
raise ValueError('Invalid template id: %r' % (id_or_xml_id,))
id_or_xml_id = self.get_view_id(cr, uid, id_or_xml_id, context=context)
self.check_access_rights(cr, uid, 'write')
self.check_access_rule(cr, uid, [id_or_xml_id], 'write', context=context)
except AccessError: