[notification] use super_session to select the recipients finder stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 22 Sep 2009 14:08:21 +0200
branchstable
changeset 3370 62ed9981a770
parent 3368 f077f4dfef9f
child 3371 762a7bc3b73d
[notification] use super_session to select the recipients finder
common/mail.py
--- a/common/mail.py	Tue Sep 22 11:13:55 2009 +0200
+++ b/common/mail.py	Tue Sep 22 14:08:21 2009 +0200
@@ -210,7 +210,13 @@
         """return a list of either 2-uple (email, language) or user entity to
         who this email should be sent
         """
-        finder = self.vreg['components'].select('recipients_finder', self.req,
+        # use super_session when available, we don't want to consider security
+        # when selecting recipients_finder
+        try:
+            req = self.req.super_session
+        except AttributeError:
+            req = self.req
+        finder = self.vreg['components'].select('recipients_finder', req,
                                                 rset=self.rset,
                                                 row=self.row or 0,
                                                 col=self.col or 0)