@@ -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
|
||||
|
||||
@@ -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 = [{}]
|
||||
|
||||
Reference in New Issue
Block a user