You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/12/12 23:21:06 UTC

incubator-ponymail git commit: More natural parameter order

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master d984bea78 -> 2ee0a35db


More natural parameter order

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

Branch: refs/heads/master
Commit: 2ee0a35db876c8a25e873166b689edc951aad66f
Parents: d984bea
Author: Sebb <se...@apache.org>
Authored: Mon Dec 12 23:20:50 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Mon Dec 12 23:20:50 2016 +0000

----------------------------------------------------------------------
 site/api/lib/utils.lua | 6 +++---
 site/api/mbox.lua      | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ee0a35d/site/api/lib/utils.lua
----------------------------------------------------------------------
diff --git a/site/api/lib/utils.lua b/site/api/lib/utils.lua
index 4db196e..8da74bc 100644
--- a/site/api/lib/utils.lua
+++ b/site/api/lib/utils.lua
@@ -60,7 +60,7 @@ end
 
 -- does the user have the rights to access the mailing list?
 -- N.B. will fail if rights or list_raw are invalid
-function canAccessList(rights, lid)
+function canAccessList(lid, rights)
     -- we don't need the name
     local flid, _ , domain = parseLid(lid)
     for _, v in pairs(rights) do
@@ -73,9 +73,9 @@ end
 
 -- does the user have the rights to access the document?
 -- N.B. will fail if doc is invalid; may fail if rights is invalid
-function canAccessDoc(rights, doc)
+function canAccessDoc(doc, rights)
     if doc.private then
-        return canAccessList(rights, doc.list_raw)
+        return canAccessList(doc.list_raw, rights)
     else
         return true
     end

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/2ee0a35d/site/api/mbox.lua
----------------------------------------------------------------------
diff --git a/site/api/mbox.lua b/site/api/mbox.lua
index afefcf5..3bffafd 100644
--- a/site/api/mbox.lua
+++ b/site/api/mbox.lua
@@ -130,8 +130,7 @@ function handle(r)
             if v.private and listAccessible == nil then
                 -- we are dealing with a single list here so only need to check once
                 if account then
-                    local rights = aaa.rights(r, account)
-                    listAccessible = canAccessList(rights, lid)
+                    listAccessible = canAccessList(lid, aaa.rights(r, account))
                 else
                     listAccessible = false
                 end