Check read access of report records

Closes #13505
This commit is contained in:
Cédric Krier
2024-09-12 16:09:39 +02:00
parent 9cec77a88c
commit b32cbb18a9
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Check read access of report records (#13505)
* Forbid editing cron when it is running
* Store last cron durations
* Use JSONB to store MultiSelection field by default
+9 -1
View File
@@ -39,7 +39,7 @@ from trytond.i18n import gettext
from trytond.pool import Pool, PoolBase
from trytond.rpc import RPC
from trytond.tools import slugify
from trytond.transaction import Transaction
from trytond.transaction import Transaction, check_access
from trytond.url import URLMixin
try:
@@ -172,6 +172,7 @@ class Report(URLMixin, PoolBase):
'''
pool = Pool()
ActionReport = pool.get('ir.action.report')
ModelAccess = pool.get('ir.model.access')
cls.check_access()
context = Transaction().context
ids = list(map(int, ids))
@@ -218,6 +219,13 @@ class Report(URLMixin, PoolBase):
if model:
records = cls._get_records(ids, model, data)
with check_access():
if model:
Model = pool.get(model)
ModelAccess.check(model, 'read')
# Check read access
Model.read(ids, ['id'])
if not records:
groups = [[]]
headers = [{}]