aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-04 03:04:00 +0200
committerKim Alvefur <zash@zash.se>2018-08-04 03:04:00 +0200
commitd9abcdd04857614e0462ad781daeea8f15b0cb1b (patch)
treee74369598a6abba7b73a49acdcb0f9887ad3aff4 /util/pubsub.lua
parent2551d819b53d0c8a9790406326dcfcae9fcc4d63 (diff)
downloadprosody-d9abcdd04857614e0462ad781daeea8f15b0cb1b.tar.gz
prosody-d9abcdd04857614e0462ad781daeea8f15b0cb1b.zip
util.pubsub: Look for a configured callback for more complicated access models
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r--util/pubsub.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 13e68280..f1d1df38 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -121,6 +121,16 @@ function service:get_default_affiliation(node, actor, action) -- luacheck: ignor
elseif access_model == "whitelist" then
return "none";
end
+
+ if self.config.access_models then
+ local check = self.config.access_models[access_model];
+ if check then
+ local aff = check(actor);
+ if aff then
+ return aff;
+ end
+ end
+ end
end
function service:set_affiliation(node, actor, jid, affiliation)