Enforce access right on the email template record

Closes #14907
This commit is contained in:
Cédric Krier committed 2026-06-30 09:48:33 +02:00
1 parent 8df60185f5
commit 2e84b60e75
2 files changed
+4 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Enforce access right on the email template record (issue14907)
* Add ModelAccessProxy (issue14907)
* Restrict Genshi evaluation (issue14869, issue5160)
* Add BrowseList for Model instances
+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 [