Issue 7765

Title
Skip access check on instance
Priority
feature
Status
resolved
Nosy list
ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2018-10-05.00:26:19 by ced, last changed 1 month ago by roundup-bot.

Messages

New changeset d5ee4e0cc24b by Cédric Krier in branch 'default':
Skip access check on ModelStorage instances
https://hg.tryton.org/tryton-env/rev/d5ee4e0cc24b
New changeset 982a131026e7 by Cédric Krier in branch 'default':
Skip access check on ModelStorage instances
https://hg.tryton.org/trytond/rev/982a131026e7
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-11-17.11:42:21

Indeed it is a more than a performance issue because on ModelView.button the decorated function is called with _check_access disabled but the records instances have still the _check_access context. So if getattr or save are called on the records for a field that user has no access, an error is raised even if she has access right to trigger the button.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-10-05.00:26:18
I think in order to avoid future similar issue than issue7764, we could remove check_access from the context when instantiate a record.
The rational is that instance can only be accessed from the code running on the server and as we have the design to check access at the border/entry point, so access from instances does not need to be checked.
History
Date User Action Args
2020-12-18 00:09:27roundup-botsetmessages: + msg63335
2020-12-18 00:09:24roundup-botsetmessages: + msg63334
nosy: + roundup-bot
status: testing -> resolved
2020-11-17 12:16:44reviewbotsetmessages: + msg61984
2020-11-17 11:47:20reviewbotsetmessages: + msg61983
nosy: + reviewbot
2020-11-17 11:45:30cedsetkeyword: + review
reviews: 322581002
status: in-progress -> testing
2020-11-17 11:42:21cedsetmessages: + msg61982
status: unread -> in-progress
type: performance -> behavior
2018-10-05 00:41:44cedsetassignedto: ced
2018-10-05 00:26:19cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)