Check read access of report records

Closes #13505
(grafted from cbd8e185bb320df9967fc41c542ef96c56ad548f)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2024-09-12 16:09:39 +02:00
parent 873d15503f
commit 86431b0e26
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Check read access of report records (#13505)
Version 6.0.51 - 2024-09-01
---------------------------
+8
View File
@@ -143,6 +143,7 @@ class Report(URLMixin, PoolBase):
'''
pool = Pool()
ActionReport = pool.get('ir.action.report')
ModelAccess = pool.get('ir.model.access')
cls.check_access()
action_id = data.get('action_id')
@@ -180,6 +181,13 @@ class Report(URLMixin, PoolBase):
if model:
records = cls._get_records(ids, model, data)
with Transaction().set_context(_check_access=True):
if model:
Model = pool.get(model)
ModelAccess.check(model, 'read')
# Check read access
Model.read(ids, ['id'])
if not records:
groups = [[]]
headers = [{}]