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/16 13:11:36 UTC
[1/2] incubator-ponymail git commit: Unused
Repository: incubator-ponymail
Updated Branches:
refs/heads/master b5a077fa2 -> 79a734b44
Unused
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/a8e771be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/a8e771be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/a8e771be
Branch: refs/heads/master
Commit: a8e771be01de5c469b4ce2ba1c8e495ad7c8b236
Parents: b5a077f
Author: Sebb <se...@apache.org>
Authored: Fri Dec 16 00:49:59 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Fri Dec 16 00:49:59 2016 +0000
----------------------------------------------------------------------
site/js/dev/ponymail_pagebuilder.js | 1 -
site/js/ponymail.js | 1 -
2 files changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/a8e771be/site/js/dev/ponymail_pagebuilder.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_pagebuilder.js b/site/js/dev/ponymail_pagebuilder.js
index 4c155d9..7cddf36 100644
--- a/site/js/dev/ponymail_pagebuilder.js
+++ b/site/js/dev/ponymail_pagebuilder.js
@@ -350,7 +350,6 @@ function getListInfo(list, xdomain, nopush) {
if (arr[1].match(/-/) && !arr[1].match(/\|/)) {
var ya = arr[1].split(/-/)
toggleEmail(ya[0], ya[1], nopush)
- var dp = document.getElementById('d')
current_retention = arr[1]
dealtwithit = true
} else {
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/a8e771be/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index 5c8de37..1d08e94 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -3993,7 +3993,6 @@ function getListInfo(list, xdomain, nopush) {
if (arr[1].match(/-/) && !arr[1].match(/\|/)) {
var ya = arr[1].split(/-/)
toggleEmail(ya[0], ya[1], nopush)
- var dp = document.getElementById('d')
current_retention = arr[1]
dealtwithit = true
} else {
[2/2] incubator-ponymail git commit: rights checking should be
localised
Posted by se...@apache.org.
rights checking should be localised
Part two of #293
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/79a734b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/79a734b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/79a734b4
Branch: refs/heads/master
Commit: 79a734b44f58774b2a5b88d78b3b27081d883926
Parents: a8e771b
Author: Sebb <se...@apache.org>
Authored: Fri Dec 16 13:11:20 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Fri Dec 16 13:11:20 2016 +0000
----------------------------------------------------------------------
site/api/lib/aaa.lua | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/79a734b4/site/api/lib/aaa.lua
----------------------------------------------------------------------
diff --git a/site/api/lib/aaa.lua b/site/api/lib/aaa.lua
index bc34543..94ae07f 100644
--- a/site/api/lib/aaa.lua
+++ b/site/api/lib/aaa.lua
@@ -32,8 +32,10 @@ pcall(function() aaa_site = require 'lib/aaa_site' end)
--[[
The module is expected to return the following:
{
- rights = function(r, account) to get the rights
+ rights = function(r, account) to get the rights (required)
validateParams = true/false (optional)
+ canAccessList = function override (optional)
+ canAccessDoc = function override (optional)
}
]]
@@ -96,15 +98,18 @@ end
parse a listid
returns the full lid, listname and the domain from "<listname.domain>"
where listname cannot contain any "." chars
-]]--
+]]
local function parseLid(lid)
return lid:match("^<(([^.]+)%.(.-))>$")
end
-- does the account have the rights to access the mailing list?
--- N.B. will fail if rights or list_raw are invalid
+-- N.B. will fail if account or lid are invalid
local function canAccessList(r, lid, account)
+ if aaa_site and aaa_site.canAccessList then -- we have a site override method
+ return aaa_site.canAccessList(r, lid, account) -- delegate to it
+ end
if not account then return false end
-- check the rights cache
local rights = account._rights_
@@ -125,6 +130,9 @@ end
-- does the account have the rights to access the document?
-- N.B. will fail if doc is invalid
local function canAccessDoc(r, doc, account)
+ if aaa_site and aaa_site.canAccessDoc then -- we have a site override method
+ return aaa_site.canAccessDoc(r, doc, account) -- delegate to it
+ end
if doc.private then
-- if not account then return false end (done by canAccessList)
-- assume that rights are list-based
@@ -137,7 +145,11 @@ end
--[[
Note that the functions do not check their parameters.
This is because they may be called frequently.
-]]--
+
+ TODO consider whether to replace the relevant local functions entirely
+ rather than using delegation if the aaa_site module provides them.
+ This would need to be done here, at the end of this module.
+]]
-- module defs
return {