ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Ensure rights are defined even if not logged in
Date Wed, 14 Dec 2016 12:26:53 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 592eaea44 -> f3b028648


Ensure rights are defined even if not logged in

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/f3b02864
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/f3b02864
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/f3b02864

Branch: refs/heads/master
Commit: f3b0286484242ecef53f845b88019362d7c5ac70
Parents: 592eaea
Author: Sebb <sebb@apache.org>
Authored: Wed Dec 14 12:26:42 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Wed Dec 14 12:26:42 2016 +0000

----------------------------------------------------------------------
 site/api/thread.lua | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f3b02864/site/api/thread.lua
----------------------------------------------------------------------
diff --git a/site/api/thread.lua b/site/api/thread.lua
index a0683cc..5689358 100644
--- a/site/api/thread.lua
+++ b/site/api/thread.lua
@@ -56,12 +56,18 @@ local function fetchChildren(r, pdoc, c, biglist, rights, account)
     local docs = elastic.findFast('in-reply-to:"' .. r:escape(pdoc['message-id'])..'"', 50,
"mbox")
     for k, doc in pairs(docs) do
         -- if we haven't seen this email before, check for its kids and add it to the bunch
-        local canAccess = true
+        local canAccess = false
         if doc.private then
-            if account and not rights then
-                rights = aaa.rights(r, account)
+            if not rights then
+                if account then
+                    rights = aaa.rights(r, account)
+                else
+                    rights = {}
+                end
             end
             canAccess = utils.canAccessDoc(doc, rights)
+        else
+            canAccess = true
         end
         
         if canAccess and (not biglist[doc['message-id']]) then


Mime
View raw message