Check read access of report records
Closes #13505 (grafted from cbd8e185bb320df9967fc41c542ef96c56ad548f) --HG-- branch : 7.0
This commit is contained in:
1 parent
261d8aa217
commit
9423c7e97d
2 files changed
+10
-1
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Check read access of report records (#13505)
|
||||
|
||||
Version 7.0.17 - 2024-09-01
|
||||
---------------------------
|
||||
|
||||
@@ -37,7 +37,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:
|
||||
@@ -163,6 +163,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))
|
||||
@@ -209,6 +210,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