Enforce access right on the email template record
Closes #14907 (grafted from d9aa2de5dabe7e39892c41808d56103ea83bf95f) --HG-- branch : 8.0
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Enforce access right on the email template record (issue14907)
|
||||
* Add ModelAccessProxy (issue14907)
|
||||
* Restrict Genshi evaluation (issue14869, issue5160)
|
||||
|
||||
|
||||
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user