Check read access of report records
Closes #13505 (grafted from cbd8e185bb320df9967fc41c542ef96c56ad548f) --HG-- branch : 6.0
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Check read access of report records (#13505)
|
||||
|
||||
Version 6.0.51 - 2024-09-01
|
||||
---------------------------
|
||||
|
||||
@@ -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 = [{}]
|
||||
|
||||
Reference in New Issue
Block a user