details: https://code.tryton.org/tryton/commit/add2f9621c46
branch: 7.0
user: Cédric Krier <[email protected]>
date: Tue Nov 24 10:45:09 2026 +0100
description:
Enforce access rights when exporting resource data
Closes #15264
(grafted from 2bc10bed0aecfcb947ce03f869428b555f4a4cf1)
diffstat:
trytond/CHANGELOG | 1 +
trytond/trytond/ir/resource.py | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diffs (23 lines):
diff -r dd1bf56f5c6a -r add2f9621c46 trytond/CHANGELOG
--- a/trytond/CHANGELOG Tue Nov 24 12:47:34 2026 +0100
+++ b/trytond/CHANGELOG Tue Nov 24 10:45:09 2026 +0100
@@ -1,3 +1,4 @@
+* Enforce access rights when exporting resource data (issue15264)
* Forbid to read the user's reset password (issue15258)
* Limit the decompressed size of request (issue15257)
* Define the forbidden fields that cannot be set as preferences (issue15256)
diff -r dd1bf56f5c6a -r add2f9621c46 trytond/trytond/ir/resource.py
--- a/trytond/trytond/ir/resource.py Tue Nov 24 12:47:34 2026 +0100
+++ b/trytond/trytond/ir/resource.py Tue Nov 24 10:45:09 2026 +0100
@@ -147,6 +147,11 @@
cls.check_access([r.id for r in records], mode='create')
return records
+ @classmethod
+ def export_data(cls, records, fields_names, header=False):
+ cls.check_access([r.id for r in records], mode='read')
+ return super().export_data(records, fields_names, header=header)
+
class ResourceMixin(ResourceAccessMixin, ModelStorage, ModelView):