Enforce access right on the email template record

Closes #14907
(grafted from d9aa2de5dabe7e39892c41808d56103ea83bf95f)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-06-30 09:48:33 +02:00
parent 24fd5e11de
commit de1a30881f
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -1,3 +1,4 @@
* Enforce access right on the email template record (issue14907)
* Add ModelAccessProxy (issue14907)
* Restrict Genshi evaluation (issue14869, issue5160)
+3 -2
View File
@@ -10,7 +10,8 @@ from genshi.template import TextTemplate
import trytond.config as config
from trytond.i18n import gettext
from trytond.model import EvalEnvironment, ModelSQL, ModelView, fields
from trytond.model import (
EvalEnvironment, ModelAccessProxy, ModelSQL, ModelView, fields)
from trytond.model.exceptions import AccessError, ValidationError
from trytond.pool import Pool
from trytond.pyson import Bool, Eval, PYSONDecoder
@@ -400,7 +401,7 @@ class EmailTemplate(ModelSQL, ModelView):
def get(self, record):
pool = Pool()
Model = pool.get(self.model.name)
record = Model(int(record))
record = ModelAccessProxy(Model(int(record)))
values = {}
for attr, key in [