diff options
| author | Olivier Dony <odo@openerp.com> | 2013-08-20 10:54:51 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2013-08-20 10:54:51 +0200 |
| commit | aa0da8414e0dde78911208a26954444bd833570f (patch) | |
| tree | be04da1b4f505f0188629fb0a475dac56ab974c7 /addons/analytic_user_function/analytic_user_function.py | |
| parent | a5ac1c4cfc9ff0610ae447bf70267bb00db9bad8 (diff) | |
| parent | e78a83ac0306a3401e4ce08d0ccecc00aabbeca2 (diff) | |
[FIX] Model.browse: prefetching should not include model-level restricted fields (with @groups)
This usually causes spurious AccessDenied errors that would
not have occurred in most cases because the restricted fields
would not be actually read/accessed.
This patch treats fields with model-level `groups` attributes
(which means access is restricted by the ORM, not just the UI)
as not prefetchable, irregardless of the actual groups that are
restricted. This agnostic approach was chosen to save the
extra group membership lookup in most cases, which is currently
not cached (caching it would be a bigger change and come with
cache invalidation issues).
In the worst case the non-prefetching will cause an extra
SQL query for each restricted field that is browsed, but in
most cases this will make no performance hit, as this
from of access control is typically used only for a few
fields.
bzr revid: odo@openerp.com-20130820085451-e1a30wfod2hc52hf
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
0 files changed, 0 insertions, 0 deletions
